Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » iText »

[iText-questions] Overlapping text in PDF

Thomas Bickel

2007-06-18

Replies:

Hi,

there seems to be a bug in iText related to PDF text layout which causes lines to overlap or am I missing something obvious here?


Code used to create the demo file:

Document doc = new Document();
PdfWriter.getInstance(doc, new FileOutputStream("pdfTest1.pdf"));
doc.open();
Paragraph para = new Paragraph();
String text = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\n";
para.add(new Phrase(text, new com.lowagie.text.Font(0, 8,0,Color.RED)));
para.add(new Phrase(text, new com.lowagie.text.Font(0, 48,0,Color.GREEN)));
doc.add(para);
doc.close();



regards,
Thomas



Attachment: pdfTest1.pdf
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
iText-questions mailing list
iText-questions@(protected)
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/
©2008 junlu.com - Jax Systems, LLC, U.S.A.