When I try to create a PDF with cfdocument and write characters like č,ć,đ Lucee just ignores it. So instead of something like “čitluk” i get “itluk”. All my charsets inside the Lucee admin are set to utf-8 and Lucee has no problem writing these characters into a .txt file.
I have tried using cfprocessingdirective for utf-8 encoding but it doesn’t work. I don’t know if this info helps, but when I download my PDF and open it with Adobe Acrobat I can see under font properties that the encoding is Ansi.
Does anybody know what could be causing my issue and how to fix it?
P.s. Is there a way to list all Lucee embedded fonts?
Hey Terry thank you for the reply, but I have already successfully imported a custom font globally with a latin extended charset before and still had the same problem. I also get an error “is not allowed for tag” when I try to use the fontnames attribute of the cfdocument tag. I also don’t see it in the documentation.
I created a fonts.jar file in opt/lucee/lib and then restarted Lucee. I noticed after that Lucee created a fonts folder in the WEB-INF/lucee/ folder and my .ttf file was located there. After that I created a PDF and could use the new font, but I still cannot write characters like “Č”.
It maybe a system os (the user your lucee tomcat is running at) doesn’t understand or have that font you need. Have you tried the ascii CHR attribute? #CHR(&##268;)# and making sure its loaded in the os? it should be in /usr/share/fonts/
Its not CHR(268) its CHR( POUND-SIGN(“#”) 268 SEMI-COLON (“;”)
You have to add the FONT to the OS and reboot.
java user for your lucee instance needs to understand font, as that is the underlying worker process that is generating the PDF, not the browser which understands UTF. Additionally, turn off SELINUX temporarily, “setenforce 0” if it is not already off, restart your services and try again after the font is loaded in the OS. Also could try the HTML unicode according to one of my cowokers, as an HTML object "č" č