Hey Guys,

I am using iTextSharp 4.1.6.0.  I noticed that when a PdfPCell contains text 
that forces it to span multiple pages, if the final line of text before the 
page break falls in just the right place, that line will be repeated on the 
next page (generic sample attached).  I worked around it by adjusting the top 
and bottom margin by a point or two.

The meat of the code I used to create the attachment is below.  I am unsure if 
the problem is with my code, iText, Reader, or some combination as I was unable 
to find anything in the documentation or searches.

            MemoryStream m = new MemoryStream();
            Document objDocument = new Document(PageSize.LETTER, 20f, 20f, 35f, 
33f);
            Response.ContentType = "application/pdf";
            PdfWriter objWriter = PdfWriter.GetInstance(objDocument, m);
            objWriter.PageEvent = objMyEvent;
            objDocument.Open();
            PdfPTable objTable = new PdfPTable(1);
            PdfPCell objCell = null;
            objTable.SplitLate = false;
            for (int i = 0; i < 4; i++)
            {
                objCell = new PdfPCell(new Phrase("Lorem ipsum dolor sit amet 
[Shortened for brevity]", FontFactory.GetFont("Arial", 10f)));
                objTable.AddCell(objCell);
            }
            objDocument.Add(objTable);
            objDocument.Close();
            Response.OutputStream.Write(m.GetBuffer(), 0, m.GetBuffer().Length);
            Response.OutputStream.Flush();
            Response.OutputStream.Close();
Thanks,
Brian

Attachment: Sample.pdf
Description: Sample.pdf

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to