Hi all,

I don't know if it's a bug, or if my code was poorly designed but
luckily working as expected, but here is some change I noticed after
upgrading from 1.4.7 to 1.4.8.

Take the following piece of code :

       Document document = new Document();
       PdfWriter.getInstance(document, new FileOutputStream("C:/test.pdf"));

       document.open();

       Paragraph paragraph = new Paragraph();
       paragraph.add(new Chunk("test test test test test test test
test test test test test test test test test test test test test test
test test test test "));

       PdfPTable table = new PdfPTable(1);
       table.setWidthPercentage(100);
       PdfPCell cell = new PdfPCell(new Phrase("TEST"));
       table.addCell(cell);

       paragraph.add(table);

       document.add(paragraph);

       document.close();

Basically, it creates a Paragraph, adds a Chunk, adds a PdfPTable,
adds the Paragraph to the Document, but the output defers when using
1.4.7 or 1.4.8 (see attachments)

With 1.4.7, the table was displayed below the text in the Chunk, sort
of adding an implicit newline before the table.

With 1.4.8, the table is displayed over the text. Adding "\n\n" to the
text of the Chunk makes all work correctly.

Could it be related to this entry in the changelog :
* Bugfix: the indentation of paragraphs was wrong when adding a
PdfPTable to a Paragraph.

Anyway, thanks again for the great work, we are massively switching to
iText in my company :D

Cheers,
alexis

Attachment: 1.4.7.pdf
Description: Adobe PDF document

Attachment: 1.4.8.pdf
Description: Adobe PDF document

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to