I am generating a document in Chinese, as well as several other languages, using conditional formatting in Jasper iReport 5. I have iTextAsian.jar in my lib folder. The generated PDF displays Chinese in IE, Firefox, Adobe, Foxit but not Chrome.
In Chrome, all the Chinese characters are missing. I have isPdfEmbedded set to true. Here is the style I am assigning to the Chinese fields. Am I not embeddeding?
<style name="DynamicFont" isDefault="true" forecolor="#000000" backcolor="#FFFFFF" isBlankWhenNull="false" fontName="SansSerif" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" isPdfEmbedded="true">
<conditionalStyle>
<conditionExpression><![CDATA[$F{locale}.toString().compareToIgnoreCase("am_ET") == 0]]></conditionExpression>
<style mode="Transparent" forecolor="#000000" fontName="SansSerif" pdfFontName="Amharic-Eng-Regular.ttf" pdfEncoding="Identity-H" isPdfEmbedded="true"/>
</conditionalStyle>
<conditionalStyle>
<conditionExpression><![CDATA[$F{locale}.toString().compareToIgnoreCase("vi_VN") == 0]]></conditionExpression>
<style mode="Transparent" forecolor="#000000" fontName="SansSerif" pdfFontName="customizationsFonts/Roboto-Regular.ttf" pdfEncoding="Identity-H" isPdfEmbedded="true"/>
</conditionalStyle>
<conditionalStyle>
<conditionExpression><![CDATA[$F{locale}.toString().compareToIgnoreCase("zh_CN") == 0]]></conditionExpression>
<style mode="Transparent" forecolor="#000000" fontName="SansSerif" pdfFontName="STSong-Light" pdfEncoding="UniGB-UCS2-H" isPdfEmbedded="true"/>
</conditionalStyle>
</style>
Is this a Chrome issue or something about the way I am generating the PDF with iReport?
Thank you very much for your time and patience.
John
-- edit --
Here is an example file: [example.pdf]: http://www.easleybooks.com/example.pdf
I assume there is no error in your code because If any errors exist, other browsers also can't to display your report correctly. There for you can try these steps to avoid your issue.
If these solutions not worked try to update jasper to it latest. I saw there are problems with older versions of jasper when viewing Chinese and Japanese.
Update -:
You have used your Chinese font as pdfFontName="STSong-Light"
in your code. Try to use any Chinese simplified font to print your pdf because in Firefox your Chinese languages understand as collection of two fonts(Microsoft YaHei and Yu Gothic) , but in Chrome it cannot understand the language even if acrobat extension is enabled. There for you have to change your Chinese font name in your pdf.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With