Hello,
I'm with a little problem about charset in RTF files.
I cannot insert text in portuguese in a rtf file. Some characters are
not recognized.

I tried two ways. Just insert the word, and insert with a specific
font. Both of them don't work.

My code:

Document document = new Document();
RtfWriter2.getInstance(document, output);
document.open();

// 1
Chunk chunk = new Chunk(text);

//2
BaseFont bFont = BaseFont.createFont(BaseFont.TIMES_ROMAN,
BaseFont.CP1252, BaseFont.EMBEDDED);
Chunk chunk = new Chunk(text,  new Font(bFont));

That´s funny because if I print this same text in a .txt file it is recognized.

Ps: RTF File content:

plural e outras abreviações e acentuação sei também que será a
música em diversas situações que salvará o homem da sua
destruição ....

Thank you in advance,
--Rafael Nunes

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php

Reply via email to