I'm trying to do something very simple with iText 1.4.8 to generate a RTF
document.
I want to create a paragraph and set its RTF paragraph style name to a given
constant.
Here is the instruction, given that getDocument() returns an instance of
com.lowagie.text.Document:

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:

java.lang.NullPointerException
at com.lowagie.text.rtf.text.RtfParagraph.<init>(RtfParagraph.java:117)
at com.lowagie.text.rtf.RtfMapper.mapElement(RtfMapper.java:137)
at com.lowagie.text.rtf.RtfWriter2.add(RtfWriter2.java:205)
at com.lowagie.text.Document.add(Unknown Source)
at [the line above]
...
Is it a known bug? Is there a workaround? Because I really need this RTF
paragraph style functionality.

--
Sébastien Arbogast

http://www.sebastien-arbogast.com
-------------------------------------------------------------------------
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