Japanese Characters using CFDocument not working

70 views
Skip to first unread message

Dave Hatz

unread,
Apr 19, 2016, 5:32:55 PM4/19/16
to Lucee
This seems to be a problem with CFDocument for years.   I have tried several of the suggestions mentioned on the web but nothing seems to be working.

We are using Lucee 4.5.2.018 final on Windows 2012 Server.

Here is sample test file

<cfprocessingdirective pageEncoding="utf-8" />

 

<cfdocument format="PDF" fontembed="true" pagetype="letter" orientation="portrait" filename=".....test.pdf" overwrite="true" marginbottom=".10" marginleft=".10" marginright=".10" margintop=".10" >

 

  <!DOCTYPE html>

    <head>

        <meta charset="utf-8">

     </head>

    <body>

Japanese characters below ..... <br />

愛知県 愛知県 <br />

秋田県 秋田県 <br />

    </body>

</html>   

 

</cfdocument>


Can someone pls point me in the right direction on how to set up our server so that we can display Japanese characters in our generated PDFs.


Thanks,

Dave

Andrew Penhorwood

unread,
Apr 19, 2016, 8:54:12 PM4/19/16
to Lucee
While not a direct answer to your problem.  I use Flaying Saucer (https://github.com/flyingsaucerproject/flyingsaucer) for my PDF generation needs.  It is easier to use and less of a pain than CFDocument.

Andrew Penhorwood

thorste...@googlemail.com

unread,
Apr 20, 2016, 3:56:42 AM4/20/16
to Lucee

Hi Andrew,
flyingsaucer looks interesting.

Do you have a hint, hot to install it in lucee?
Do I only have to drop the jars in a folder of the java classpath?

Regards
Thorsten

Andrew Penhorwood

unread,
Apr 20, 2016, 7:49:33 AM4/20/16
to Lucee
Just drop the jar files on the classpath.  There might be an issue the the iText version being run by Lucee.  I believe I just used the latest iText.jar of the 2.x versions and removed the any others.  I am not in a place to look at my configuration now.  I also have some code that creates the need objects for you to access it from CFML.

I will try to post some code later today.

Andrew Penhorwood

Nando Breiter

unread,
Apr 20, 2016, 11:56:20 AM4/20/16
to lu...@googlegroups.com
Dave,

I'm curious what you have tried and what has not worked for you. Have you tried to install a font that will render Japanese on the server? See my blog post here https://dnando.github.io/blog/2015/07/01/generating-accurate-pdfs-using-cfdocument/ under Custom fonts.

There are only a very limited set of fonts installed on both ACF and Lucee, and I somehow doubt they have Japanese characters. You could try installing a font that does on the server and then add a CSS style within the cfdocument tag that specifies that the font you installed should be used for the Japanese characters on the page. 



Aria Media Sagl
+41 (0)76 303 4477 cell
skype: ariamedia

--
Love Lucee? Become a supporter and be part of the Lucee project today! - http://lucee.org/supporters/become-a-supporter.html
---
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/a2ea4b46-1ca2-41e6-a863-08e8d32bfe4a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages