Generate PDF from Document Template,can not display chinese.

0
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  
asked
3 answers
2

You need to add a chinese font to your resource map. This blog post tell's you how to do that: https://www.notion.so/Generating-PDF-A-compliant-documents-01ff7b8462e0404eac21b178784cae7d

Regards,

Ronald

 

answered
1

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

Ex:

 <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"/>

</font>

 

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 .

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

Hope it is helpful :)

answered
0

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

answered