Hello,

I have a problem when creating rtf file.
When selecting blue color font in a phrase, next phrases are blue too....
What's wrong in my code ?

Thanks for help

Eric
[EMAIL PROTECTED]



--------------------------------------------------------------------------------

// Here is my sample
Document document = new Document();

RtfWriter2.getInstance(document, new FileOutputStream("HelloWorld.rtf"));
PdfWriter.getInstance(document, new FileOutputStream("HelloWorld.pdf"));

document.open();

// Selecting blue font
document.add(new Phrase("Hello World in blue!", new Font(Font.TIMES_ROMAN, 8, 
Font.NORMAL, Color.BLUE) ));

// No color 
// blue in rtf !
// black in pdf
document.add(new Phrase("Hello World !"));

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