kshitiz
kshitiz

Reputation: 21

Displaying multilanguage characters in pdf through itext(java)

I am facing problem with displaying the chinese , russian etc local languages characters.It is showing blank there.Using the itext. Is there a some standard encoding and font which after converting every character into unicode hexadecimal will take care.

Upvotes: 2

Views: 9354

Answers (2)

ChickenTurd
ChickenTurd

Reputation: 1

Try using FontSelector. You can add multiple fonts and it will process your text and use the different fonts where appropriate.

 FontSelector selector = new FontSelector();
    selector.addFont(FontFactory.getFont(FontFactory.TIMES_ROMAN, 12));
    selector.addFont(FontFactory.getFont("MSung-Light",
        "UniCNS-UCS2-H", BaseFont.NOT_EMBEDDED));
    Phrase ph = selector.process(TEXT);
    document.add(new Paragraph(ph));

from http://itextpdf.com/examples/iia.php?id=214

Upvotes: 0

Jigar Joshi
Jigar Joshi

Reputation: 240996

Make your pdf encoding to UTF-8 use font that supports unicode, Here is similar Question

  BaseFont unicode =
                BaseFont.createFont("c:/windows/fonts/arialuni.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED);    

Also see:

Upvotes: 2

Related Questions