Generate PDF from Document Template,can not display chinese.

Hi, I am using document template to generate a pdf file.    then content of it is Chinese language. But the pdf document only can display english chars,  all chinese char display with ‘#’. I have do the app translation on document template.  and set the language to ‘zh_CN’ .    but still not work. What more should i to do? Regards Haiji  
3 answers

You need to add a chinese font to your resource map. This blog post tell's you how to do that:





HI Hiji Du,

The Link given by Ronald is absolutely right.
Might be i can give you few more suggestions. Instead of creating a new fop.Xocnf file in your resource folder we can just copy the fop.xconf file from the Directory where mendix modelor is installed.  Ex:  C:\Program Files\Mendix\\runtime\lib, in this directry copy the Fop.xcponf file and paste it in your Ressource folder. 

Then download the ttf files for Chinese language and place it in the Resources folder. Now open the fop.xocnf file and you should add your code in between the <fonts> </fonts> tags.


 <font kerning="yes" embed-url="arialbd.ttf" embedding-mode="full">

<font-triplet name="Arial" style="normal" weight="bold"/>

<font-triplet name="ArialMT" style="normal" weight="bold"/>



The triplet name should be same as mentioned in the TTF file. you can open the ttf file and find the font name. 

Note : You should downlaod the TTf for all triplets mentioned int he Xconf file.

After this set up is done, Should go to your Template document and you should add you custom css to your dynamix text in document .

font-family: ‘your font name defined in the fop.conf file’ 

Hope it is helpful :)


This is the pdf content.    Try to generate  html and word file, they display correct.