Jump to content
We've recently updated our Privacy Statement, available here ×

How to print Chinese characters in PDF?


Selva_ms7
Go to solution Solved by C-Box,

Recommended Posts

Hi ,

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

<font fontName="Arial Unicode MS" size="8" pdfEncoding="Cp1250" isPdfEmbedded="true"/>
                </textElement>
                <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>
            </textField>

 

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 

 

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • Solution

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.: https://community.jaspersoft.com/documentation/tibco-jaspersoft-studio-user-guide/v640/working-font-extensions

hth + regards

C-Box

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...