Skip to main content
Participating Frequently
Nov 3, 2022 3:23 PM UTC
Question

CFHTMLTOPDF requires to force charset with Colfusion2021

I was using cfhtmltopdf with coldfusion11

 

After migration to coldfusion2021, I need to update my code to force charset otherwise special characters are no more displayed.

 

Just adding  <meta charset="iso-8859-1"> at the beginning of html code to be converted to pdf.

 

Is there any configuration to be done in jetty or coldfusion jvm to avoid such modification ?

    This topic is closed to new replies. Start a new post to keep the conversation going.

    13 replies

    BKBK
    Community Expert
    Community Expert
    Nov 6, 2022 3:46 PM UTC

    Do the following:

    1.  Remove the charset meta tag from cfhtmltopdf;
    2.  Open /bin/jvm.config in a text editor and add -Dfile.encoding=UTF8 to the java.args variable;
    3.  Restart ColdFusion 2021.

     

     

    Translate
    Participating Frequently
    Nov 7, 2022 9:28 AM UTC

    Thank you BKBK but it doesn't work. I have tried several -Dfile.encoding but with no result.

    Translate
    BKBK
    Community Expert
    Community Expert
    Nov 7, 2022 12:34 PM UTC

    It should work. Please share the code of CFM page containing cfhtmltopdf. We can then test it.

    Translate