Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert UTF-8 string to RTF string in java?

Tags:

java

rtf

Currently my project need export report to MS Word , and i choose using RTFTemplate engine to do it. But my problem is I need convert all character to RTF string first . Everyone have experiment with this problem can suggest me ?

like image 491
tandaica0612 Avatar asked Nov 06 '22 09:11

tandaica0612


1 Answers

Yes.
You can use RtfDocument from iText:
new RtfDocument().filterSpecialChar(baos, sentence, true, true);

I've described it with details in my blog:
http://lechlukasz.wordpress.com/2010/02/03/rtftemplate-and-character-encoding/

like image 174
Danubian Sailor Avatar answered Nov 11 '22 04:11

Danubian Sailor