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

try this code:


public class PdfTest {
    public static void main(String[] args) {
    
        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);
            for (int i = 20; i < 30; i++) {
                Paragraph paragraph = new Paragraph();
                for (int j = 0; j < i; j++) {
                    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