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

JasperReport Export PDF Render Khmer Unicode incorrectly in JAVA


piseth.ath

Recommended Posts

I currently user JasperReport 6.12.2 to export PDF which has Khmer Unocde in side.
I test with JasperReport Studio. It's working great as result below: 
good.jpg.d0e1c4ef95b6cf8c3c2483a168e9c191.jpg

but when I use java code export in eclipse it export incorrectly as below result: 

bad.jpg.9e2943c5a8bbf9b3a7566ec40e516fc5.jpg

I'm a newer to use JasperReport. Please help me.
I've read document of JasperReport and I added dependency as follow:
itextpdf-5.5.13.1.jar
jasperreports-6.12.2.jar

jasperreports-fonts-6.12.2.jar

jasperreports-chart-themes-6.12.2.jar

jasperreports-metadata-6.12.2.jar

I use JRE 1.8 with Apache Tomcate 7.
I tried encode export to UTF-8 but it sill not work.

Please help me, Best Regars,

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted Images

You have to import the font that supports Khmer Unicode to your Java application. 
You can check the demo project here: https://github.com/TIBCOSoftware/jasperreports/releases

Download the http://jasperreports-6.12.2-project.zip/, unzip and check the demosamplesfonts.

Basically, import your font, check the fonts.xml. Then create 2 properties files, jasperreports.properties and jasperreports_extension.properties.

Bingo, your text display correctly.

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...