itextsharp pdf creation(unwanted empty pages)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shilpa george
    New Member
    • Oct 2011
    • 15

    itextsharp pdf creation(unwanted empty pages)

    Hi All,

    I am trying to create a pdf using Itextsharp 3.1.3.0. [Platform is ASP.Net 2.0 +C#]. I have given a small portion of the code here.. In my code i am using 2 loops(one is inner loop) to create the pdf. I got the pdf with all the details and the overall look is gud but the problem is empty pages are created in between some records.. I was trying to add new line in my pdf.. I removed all Paragraphs and newline constant(\n)but still have that problem. I searched a solution for this but not getting any right answer. Could anyone please help me with this??


    Code:
    iTextSharp.text.Table headtable1 = new iTextSharp.text.Table(1, 1);
                    float[] n ={ 100f };
                    headtable1.Widths = n;
                    headtable1.Cellpadding = 0;
                    headtable1.Cellspacing = 0;
                    headtable1.SpaceBetweenCells = 0;
                    headtable1.Border = iTextSharp.text.Rectangle.NO_BORDER;                
                    headtable1.SetAlignment("left");
                    headtable1.AutoFillEmptyCells = true;
    
                    Phrase txtph1 = new Phrase();
    
                    txtph1 = new Phrase(lbl_meetname.Text + " ", FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 13, iTextSharp.text.Font.NORMAL, iTextSharp.text.Color.BLACK));
                    Cell headcell1 = new Cell(txtph1);
                    headcell1.Border = iTextSharp.text.Rectangle.NO_BORDER;
                    headcell1.SetHorizontalAlignment("left");
                    headtable1.AddCell(headcell1, 1, 0);
                    doc.Add(headtable1);
    Last edited by Meetee; Feb 20 '13, 09:43 AM. Reason: code tags [CODE/] added
Working...