Problem with chinese characters in PDF



We have Lucee 5.1 installed on a server running CentOS 6.

Our application generates sales orders as PDF that include Chinese characters.

We have no problems saving Chinese characters to the database or calling them up, and no problem displaying them on screen. The Chinese characters in the PDF are hardcoded.

We are generating the PDF by creating an HTML document and then using CFDOCUMENT to convert it to PDF

To get this to work in Coldfusion, we registered the font pack (SimSun) in the Coldfusion administrator.

We cannot get this font to register in Lucee.

Here is a simplified version of the code that is generating the PDF

<cfprocessingdirective pageencoding="utf-8">

<cfdocument format="pdf" orientation="portrait" pagetype="a4">
<!doctype html>
<meta charset="utf-8">
<title>SimSun Test</title>
body,td,th{font-family:SimSun,Lucida Sans Unicode, sans-serif,Helvetica, Arial; font-size:12px;}

电话 Tele:<br>
传真 Fax:<br>
开户行:Bank name:<br>
银行账号 Bank Account<br>



This page renders the test as HTML

This page generates the test as PDF

So far we have tried:

  • creating opt/lucee/lib/fonts.jar with the font in it
  • creating opt/lucee/jdk/jre/jre/lib/fonts/SimSun.ttf

Any tips (preferably to just get this working like it should and not having to use something like wkhtml2pdf

Add new font for cfdocument

We have solved this problem ourselves. Lucee 5 does not install a font.jar file itself (I think 4.5 and earlier did)

So we had to create it ourselves… but it has to be created in a specific way with specific properties

But it is now working for us.


It would be awesome if you could give an example of how you solved this problem :slight_smile:


In order to add a custom font to Lucee (version 5.0/5.1), you need to create a file called fonts.jar.

The fonts.jar file is essentially a zip file containing a specific files structure as below:


It is quite important that the fonts/ directory exists in this archive file, and that the files reside within it.

The is a file specifying the name(as used by Lucee) of the font and the file which it is associated with.

Our file contains this one line:


If you need to load more fonts, you can add them all into this same jar file, listing each of the fonts on a new line within the file.

Note: If your font name contains spaces, they need to escaped in the file:

eg. Times\ New\ Roman.ttf

Once the jar file has been created, copy it into the Lucee lib directory, in this case it would be:


Make sure the file has the same permissions as the existing lucee-xxx.jar file in the same location.

Restart the Lucee service to load the new fonts file.

Travis Catlett
Senior Developer
Rone Webtech

Custom Fonts in CFDocument

not worked, can you share your fonts.jar ???


The maximum upload size for this site is 3Mb and the file is 5Mb so please download it here.
You might have to modify the structure of the file to deal with your server.


thank you very much, it’s 100% worked