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  
4 answers

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





After spending lots of time R&D to make PDF display Chinese font, instead of ‘###’.

This is the result in PDF:


Additional Note:
Changing the Default Log Level from ‘Info’ → ‘Trace’ (allow me to understand regarding how Mendix read the font-triplet name (eg. lower-case “arial unicode ms”, instead of “Arial Unicode MS”)


fyi, you will need to copy the "original fop.xconf”, and paste into your resource.
 →  “yourproject-main\resource\”


File path: ...yourproject-main\resources\fop.xconf

<font kerning="yes" embed-url="arial-unicode-ms.ttf" embedding-mode="full">
	<font-triplet name="arial unicode ms" style="normal" weight="normal"/>


Overview on how I apply the “arial unicode ms” to diplay Chinese word

you need to download the “Arial Unicode MS” from the internet, and then rename the file to “arial-unicode-ms.ttf” (easier to use this name)

you may read to get more info.


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.