How to print Chinese characters in PDF?

Hi ,

I created a report which generates chinese characters also,my code is

<font fontName="Arial Unicode MS" size="8" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
                <textFieldExpression><![CDATA[($F{PCONA_ADDR1}!=null ? $F{PCONA_ADDR1} +"<br>": "") + ($F{PCONA_ADDR2}!=null ? $F{PCONA_ADDR2} +"<br>": "") +
($F{PCONA_ADDR3}!=null ? $F{PCONA_ADDR3}:"")]]></textFieldExpression>


It is working fine in ireport internal preview when i export it has PDF format it is not working it is printing like "?????????" instead of chinese characters 

how to print chinese charcters and other charcters in PDF.


Thanks in advance



Selva_ms7's picture
Joined: Apr 12 2019 - 12:00am
Last seen: 1 month 4 weeks ago

1 Answer:

I guess you will have to build a font-extension for your Arial-Unicode font and set the pdf-encoding to IDENTITY-H and not to Cp1250 (what is central european... a bit far away from our chinese friends!??! :-) )

Also I'd advice not to adjust the pdf-encoding stuff at each single TextElement level but instead on a default-style report level... otherwise the report is heavy to maintain later.

The font-extension must be within the classpath or your java-application (if you export reports from that and not only from designer)

just see the JasperReports Docus e.g.:

hth + regards


C-Box's picture
Joined: Jul 19 2006 - 5:58pm
Last seen: 3 months 4 days ago