Forums

TCPDF does not recognize HTML entity for UTF-8 Latin Extended characters

Andrea1987 23 Jan, 2019
Hello,
I am using TCPDF to generate a PDF document from data collected in a form: I cannot understand why some HTML entity, well inside the "<p>" tag, are not recognized by TCPDF and they are being displayed like normal text or "?".

For example, a code like this one:

<p>I will display &Dstrok;</p>

<p>I will display &#272;</p>
<p>I will display &#x0110;</p>

Is translated like this:



Any Idea to configure TCPDF (or Chronoform maybe?) to recognize those extended characters?
Thanks a lot🙂

Andrea
healyhatman 23 Jan, 2019
Works for me


If I were you I'd check what fonts your site or template is using.
Andrea1987 24 Jan, 2019
I am using TCPDF as an Action inside Chronoform Setup. The problem is: from there I cannot modify the Encoding of the generated document.
As someone said here (https://www.chronoengine.com/forums/posts/t105590/p377759/customize-tcpdf-pdf-file?startat=0) there is no way to add php code to configure the TCPDF previously added as an Action.

Did someone have to use extended charset in their pdf generated via TCPDF already? Is it possible to do it using just the Chronoform plugin?

Thanks a lot!
Andrea
healyhatman 25 Jan, 2019
OK so TCPDF comes with 3 fonts, none of which have latin extended characters.

What you need to do is add another font.

Here are three files, in a zip. Extract them to libraries\cetcpdf\tcpdf\fonts. Then set your body font in your TCPDF action to opensans

​[file=11520]fonts.zip[/file]
healyhatman 25 Jan, 2019
Just be aware you *MIGHT* need to put these back in after updating CF or TCPDF. Additionally, if you'd like to use a DIFFERENT font, you can convert it here

http://fonts.snm-portal.com/
Andrea1987 25 Jan, 2019
It worked perfectly. Thank you very much healyhatman!

Andrea
This topic is locked and no more replies can be posted.