On Wednesday 10 January 2007 10:53, Sebastien Arbogast wrote:
> getDocument().add(new Paragraph("Hello World!", new
> RtfParagraphStyle("TEST", "Arial", 20, RtfFont.STYLE_ITALIC,
> Color.BLACK))); When I run it, here is the exception I get:
>
> Is it a known bug? Is there a workaround? Because I really need this RTF
> paragraph style functionality.
I've finally found the time to look at your code in detail and here is where 
you are going wrong. You need to register the style with the writer first, 
before you can use it:

RtfParagraphStyle style = new RtfParagraphStyle("TEST", "Arial", 20,
    RtfFont.STYLE_ITALIC, Color.BLACK);
writer.getDocumentSettings().registerParagraphStyle(style);
doc.add(new Paragraph("Hello World!", style));

Greetings,
Mark
-- 
Your step will soil many countries.

My GPG public key is available at:
http://www.edu.uni-klu.ac.at/~mhall/data/security/MarkHall.asc

Attachment: pgpzlLXbsD8bf.pgp
Description: PGP signature

-------------------------------------------------------------------------
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