By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,139 Members | 1,306 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,139 IT Pros & Developers. It's quick & easy.

itextsharp pdf creation(unwanted empty pages)

shilpa george
P: 15
Hi All,

I am trying to create a pdf using Itextsharp [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??

Expand|Select|Wrap|Line Numbers
  1. iTextSharp.text.Table headtable1 = new iTextSharp.text.Table(1, 1);
  2.                 float[] n ={ 100f };
  3.                 headtable1.Widths = n;
  4.                 headtable1.Cellpadding = 0;
  5.                 headtable1.Cellspacing = 0;
  6.                 headtable1.SpaceBetweenCells = 0;
  7.                 headtable1.Border = iTextSharp.text.Rectangle.NO_BORDER;                
  8.                 headtable1.SetAlignment("left");
  9.                 headtable1.AutoFillEmptyCells = true;
  11.                 Phrase txtph1 = new Phrase();
  13.                 txtph1 = new Phrase(lbl_meetname.Text + " ", FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 13, iTextSharp.text.Font.NORMAL, iTextSharp.text.Color.BLACK));
  14.                 Cell headcell1 = new Cell(txtph1);
  15.                 headcell1.Border = iTextSharp.text.Rectangle.NO_BORDER;
  16.                 headcell1.SetHorizontalAlignment("left");
  17.                 headtable1.AddCell(headcell1, 1, 0);
  18.                 doc.Add(headtable1);
Feb 20 '13 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.