devendragoleit_1 Posted November 11, 2014 Share Posted November 11, 2014 Hi, I am trying to display Chinese character in jasper report as a pdf file. but it is not diaplaying in pdf format. Also, i added iTextAsian Jar and font but still i am getting below exception: net.sf.jasperreports.engine.JRRuntimeException: Could not load the following font : pdfFontName : Helvetica pdfEncoding : Identity-H isPdfEmbedded : false Link to comment Share on other sites More sharing options...
hozawa Posted November 11, 2014 Share Posted November 11, 2014 That's probably because Helvetica doesn't contain Chinese characters. Specify a font that contains Chinese characters. Link to comment Share on other sites More sharing options...
devendragoleit_1 Posted November 12, 2014 Author Share Posted November 12, 2014 Thanks for your support. I tried STSong-Light font also. And both font works when i click on preview in IReport and generate PDF. But when i am calling from Java then i am getting above exception. Also, I added extension of font into Application class path that i have created from IReport Link to comment Share on other sites More sharing options...
devendragoleit_1 Posted November 21, 2014 Author Share Posted November 21, 2014 Hello Team,I got the solution and issue resolved..There are following things that we have to change:-1> We have to set following property from Java: a: JRProperties.setProperty("net.sf.jasperreports.default.pdf.font.name","ARIALUNI_0.TTF"); b: JRProperties.setProperty("net.sf.jasperreports.default.pdf.encoding", "Identity-H"); 2> We have to remove all the pdffontname tag in JRXML. 3> Set JPR and JWS encoding property to 'UTF-8'. Link to comment Share on other sites More sharing options...
jaspersoft123 Posted December 8, 2014 Share Posted December 8, 2014 1. download and use Arial Unicode font jar - https://community.jaspersoft.com/sites/default/files/files/Report24775-eastAsian.zip 2. add this jar in 2 places - a) webapps-jasperserver-WEBINF-lib (add here) b) in Ireport u need to add in classpath. (tools-options-classpath) 3.set font name as "Arial Unicode MS" and keep same property set in ur xml <font fontName="Arial Unicode MS" size="12" isBold="true" pdfFontName="Arial Unicode MS" pdfEncoding="Identity-H" isPdfEmbedded="true"/> 4. restart ur jasperserver. 5. restart ur ireport. Link to comment Share on other sites More sharing options...
devendragoleit_1 Posted December 8, 2014 Author Share Posted December 8, 2014 Thanks for response. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now