Patrick Kaegi wrote:
ok! me again! i think now we have the solution:
it's the font size which makes the problem.

try this code

In attachment you find a code sample that reproduces the problem.
I have uploaded a fix to CVS (classes PdfDocument and PdfChunk)
that solves the problem.
Thanks for reporting the bug, and especially for providing a code
sample that reproduces the problem. That made it easier for me to
write a bugfix.
br,
Bruno
package test;

import java.io.FileOutputStream;
import java.io.IOException;

import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
import com.lowagie.text.Font;
import com.lowagie.text.Paragraph;
import com.lowagie.text.Phrase;
import com.lowagie.text.pdf.PdfWriter;

public class PatrickKaegi {
        public static void main(String[] args) {
                Document.compress = false;
                Document document = new Document();
                try {
                        PdfWriter.getInstance(document, new 
FileOutputStream("patrick.pdf"));
                        document.open();
                        Font normalFont = new Font();
                        normalFont.setSize(11);
                        Font boldFont = new Font(Font.HELVETICA, 12, Font.BOLD);
                        Paragraph paragraph = new Paragraph();
                        for (int i = 0; i < 27; i++) {
                                paragraph.add(new Phrase("foo ", normalFont));
                        }
                        paragraph.add(new Phrase("bold", boldFont));
                        paragraph.add(new Phrase(" bar", normalFont));
                        document.add(paragraph);
                } catch (IOException e) {
                        e.printStackTrace();
                } catch (DocumentException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                }
                document.close();
        }
}
-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to