I want to use iText with java to create pdf with traditional chinese characters particularly the hong kong big5 extention fonts Big5_HKSCS. I use tutorial 9 Chap0909.java to test but found that in the output pdf, the hong kong characters like \u90A8, \uF303 become blank if the java string is in utf8 and become ? if use Big5_HKSCS encoding for my string.

Also, I have to print data to pdf from postgresql database which is mainly using traditional chinese and hong kong fonts in form/table format.

Any help would be appreciate.


Part of my test code:
**********************
......
// step 3: we open the document
document.open();
String chistr = "\u8CC7\u6599 abc123 - \u4E8B\u4EF6 [ \u90A8 & \uF303 ]";
String pdfstr = new String(chistr.getBytes(), "Big5_HKSCS");

// step 4: we add content to the document

BaseFont bfChinese = BaseFont.createFont("MHei-Medium", "UniCNS-UCS2-H", BaseFont.NOT_EMBEDDED);

Font FontChinese = new Font(bfChinese, 12, Font.NORMAL);

Paragraph chunk = new Paragraph(pdfstr, FontChinese);

document.add(chunk);

......

_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to