Wplms Pdf Certificate: Tcpdf Utf-8 Bad Encoding With Special Characters Displays on Pdf Certificate

If Something strange is happening with your pdf certificate, If you are using languages for pdf certificate like greek, Latin, Russian, Lithuanian, Turkish, Chinese, Hindi etc. and while generating pdf certificate you get few of its characters and other remains special symbols like this ??????.

Then the question arises what should we do now??

TCPDF is quite tricky with utf8. Best way to achieve what you want is to embed the font in the generated PDF file itself. You can use FreeSerif/ OpenSans font from the TCPDF package, it contains all the utf-8 symbols, shows absolutely any character of any language. That’s probably the easiest way to get symbols you need.

You could also make your own font to embed, containing the characters you need. That’s probably the best solution, keeping it universal and small in size, but is more complex.


Follow the steps for Turkish language:

Freesans font download link: https://github.com/opensourcedesign/fonts/blob/master/gnu-freefont_freesans/FreeSans.ttf?raw=true

Here is the steps you need to follow:

  1. Download the font from above link Or upload your own fonts which support TrueType encoding with utf-8.
  2. Upload this custom font file (FreeSans.ttf) in your pdf certificate.
  3. Use the uploaded font for the certificate texts, when you generate certificate this time issue will be resolved.

Now it looks like this: 


Follow the steps for the Russian language:

DejaVuSerif font download link: https://www.fontsquirrel.com/fonts/dejavu-serif

Here is the steps you need to follow:

  1. Download the font from the above link. Refer: http://prntscr.com/nlem8f
  2. Upload this custom font file (FreeSans.ttf) in your pdf certificate.
  3. Use the uploaded font for the certificate texts, when you generate certificate this time issue will be resolved.

Here is how it works: http://somup.com/cqhi1Mn45W

 


Follow the steps for the Arabic language:

aealarabiya font download link: aealarabiya.ttf_.zip

Here are the steps you need to follow:

  1. Download the font from the above link. Refer: https://cl.ly/5237c1
  2. Upload this custom font file (aealarabiya.ttf) in your pdf certificate.
  3. Use the uploaded font for the certificate texts, when you generate certificate this time issue will be resolved.

Here is how it works: https://screencast-o-matic.com/watch/cq1YItTdyr



Follow the steps for the Chinese language:

AREALUNI font download link: https://github.com/kaienfr/Font/blob/master/font/ARIALUNI.TTF

Here are the steps you need to follow:

  1. Download the font from the above link
  2. Upload this custom font file (AREALUNI.ttf) in your pdf certificate.
  3. Use the uploaded font for the certificate texts, when you generate certificate this time issue will be resolved.

Here is how it works: http://somup.com/cqQ0lKeEeW

results: http://prntscr.com/p9tjzi

Note: use exact font name as written in bold line else it will not work.



Follow the steps for the HINDI language:

AREALUNI or FREE SANS font download link:

  1. https://github.com/kaienfr/Font/blob/master/font/ARIALUNI.TTF
  2. https://github.com/opensourcedesign/fonts/blob/master/gnu-freefont_freesans/FreeSans.ttf?raw=true

Here are the steps you need to follow:

  1. Download the font from the above link. Refer: https://cl.ly/5237c1
  2. Upload this custom font file (AREALUNI.ttf) || FREESANS in your pdf certificate.
  3. Use the uploaded font for the certificate texts, when you generate a certificate this time issue will be resolved.

Here is how it works: http://somup.com/cqltjwf5U3

results: https://share.getcloudapp.com/L1ukNqPJ

Note: use exact font name as written in bold line else it will not work.

Leave a Reply

Your email address will not be published. Required fields are marked *