# Unicode characters missing in cfdocument pdf

**URL:** <https://dev.lucee.org/t/unicode-characters-missing-in-cfdocument-pdf/14667>\
**Category:** support\
**Created:** [January 31, 2025, 1:40am UTC](https://dev.lucee.org/t/unicode-characters-missing-in-cfdocument-pdf/14667 "2025-01-31T01:40:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sean\_S1](https://dev.lucee.org/letter_avatar_proxy/v4/letter/s/8edcca/32.png) [@Sean\_S1](https://dev.lucee.org/u/Sean_S1)\
**Post date:** [January 31, 2025, 1:40am UTC](https://dev.lucee.org/t/unicode-characters-missing-in-cfdocument-pdf/14667/1 "2025-01-31T01:40:06Z")

</div>

I’ve been attempting to figure out why unicode characters aren’t showing up in my PDF on Lucee 6 on windows 2022. They are just blank. I can verify the Chinese chars in the HTML but the PDF is just blank. I’ve tried making a fonts.jar file with simsun.ttf in it with the proper line in pd4fonts.properties. I’ve tried doing various CSS ways to include the local files. I’ve tried doing font directory pointing at a font directly with the .ttf and the fonts.jar . so far no luck. Any other ideas I can try?

This is all with type=“modern” for cfdocument

I’m using `fontembed="true"` in the cfdocument

I’ve attempted using fontdirectory in two ways.

`fontdirectory="D:\fonts"`  
`fontdirectory="#expandPath('../fonts')#"`

I’ve attempted putting the fonts.jar file in the following:

`D:\Lucee\lib`  
`D:\Lucee\jre\lib`  
`D:\Lucee\tomcat\lucee-server\context\lib`

I’ve tried putting the SimSun.tff here  
`D:\Lucee\tomcat\lucee-server\context\fonts`

Anyone have any ideas on what I can try next or what I’m doing wrong? Thanks.

_Don’t forget to tell us about your stack!_

**OS** : Windows Server 2022 Datacenter  
**Java Version** : 11.0.23  
**Tomcat Version** : 9.0.89  
**Lucee Version** : 6.1.1.118

---

<div class="post-metadata">

**Author:** ![Terry\_Whitney](https://dev.lucee.org/user_avatar/dev.lucee.org/terry_whitney/32/3322_2.png) [@Terry\_Whitney](https://dev.lucee.org/u/Terry_Whitney)\
**Post date:** [February 4, 2025, 1:57pm UTC](https://dev.lucee.org/t/unicode-characters-missing-in-cfdocument-pdf/14667/2 "2025-02-04T13:57:24Z")

</div>

Take a look at both of these threads.

> **[cfdocument :: Lucee Documentation](https://docs.lucee.org/reference/tags/document.html)**
>
> Creates a PDF document from a text block containing CFML and HTML.

> [@Custom Fonts in CFDocument](https://dev.lucee.org/t/custom-fonts-in-cfdocument/2715/10):
>
> I’m not sure I have a specific question, at this point. I have, as far as I can tell, followed the instructions meticulously, but I can’t get my fonts to print to a pdf generated by cfdocument. Here’s what I’ve tried. If anyone can tell me what I’m missing, I would certainly appreciate it. I downloaded the fonts.jar from [Log in with Atlassian account](https://luceeserver.atlassian.net/browse/LDEV-12732), changed it to a zip, added my .ttf files, updated the pd4fonts.properties files, saved and renamed to fonts.jar. I verified that the .ttf and…

---

<div class="post-metadata">

**Author:** ![cmarvin](https://dev.lucee.org/letter_avatar_proxy/v4/letter/c/838e76/32.png) [@cmarvin](https://dev.lucee.org/u/cmarvin)\
**Post date:** [April 12, 2025, 2:18am UTC](https://dev.lucee.org/t/unicode-characters-missing-in-cfdocument-pdf/14667/3 "2025-04-12T02:18:38Z")

</div>

Did you ever solve this issue? I am having the same problem.

---

<div class="post-metadata">

**Author:** ![Sean\_S1](https://dev.lucee.org/letter_avatar_proxy/v4/letter/s/8edcca/32.png) [@Sean\_S1](https://dev.lucee.org/u/Sean_S1)\
**Post date:** [April 15, 2025, 5:05pm UTC](https://dev.lucee.org/t/unicode-characters-missing-in-cfdocument-pdf/14667/4 "2025-04-15T17:05:41Z")

</div>

I never did figure this out. I wish there was a clear use this jar file of fonts and put it here and it’ll work.

I had to do a round about method to generate these. Since these aren’t common that have chars that aren’t displaying right, I have to output an HTML page and then print and save as PDF. Not ideal at all. It worked enough until I can find time to work on this again.

---

<div class="post-metadata">

**Author:** ![cmarvin](https://dev.lucee.org/letter_avatar_proxy/v4/letter/c/838e76/32.png) [@cmarvin](https://dev.lucee.org/u/cmarvin)\
**Post date:** [April 16, 2025, 2:48am UTC](https://dev.lucee.org/t/unicode-characters-missing-in-cfdocument-pdf/14667/5 "2025-04-16T02:48:46Z")

</div>

Thanks for your reply - I was finally able to get it working. I ended up using the fontdirectory attribute of cfdocument.

---

<div class="post-metadata">

**Author:** ![Sean\_S1](https://dev.lucee.org/letter_avatar_proxy/v4/letter/s/8edcca/32.png) [@Sean\_S1](https://dev.lucee.org/u/Sean_S1)\
**Post date:** [April 16, 2025, 3:58pm UTC](https://dev.lucee.org/t/unicode-characters-missing-in-cfdocument-pdf/14667/6 "2025-04-16T15:58:27Z")

</div>

cmarvin , can you post the code you were using with cfdocument using fontdirectory to make this work?

---

<div class="post-metadata">

**Author:** ![cmarvin](https://dev.lucee.org/letter_avatar_proxy/v4/letter/c/838e76/32.png) [@cmarvin](https://dev.lucee.org/u/cmarvin)\
**Post date:** [April 18, 2025, 4:01pm UTC](https://dev.lucee.org/t/unicode-characters-missing-in-cfdocument-pdf/14667/7 "2025-04-18T16:01:35Z")

</div>

`<cfdocument overwrite="yes" format="pdf" pagetype="A4" orientation="portrait" fontEmbed="true" unit="cm" localUrl="true" filename="#ExpandPath('/temp/')##newFileName#.pdf" marginleft="0" marginright="0" fontdirectory="#expandPath('/fonts/')#" >`

Here you are - I think the trick is to use the proper font names when calling them. They are specified in the ttf files themselves.
