Unicode characters missing in cfdocument pdf

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

Take a look at both of these threads.

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

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.

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

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

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