Unicode/UTF8 characters in PDF invoice / embed font in PDF
If you are having trouble with multiple languages or special characters displaying within a PDF please try this:
Go to Settings > Advanced > change the 'pdf_library' value to:
pdfrocket
Then visit http://www.html2pdfrocket.com/Account/Register and sign up for an API key (choose PHP as language). You will receive an API key in your email. This should allow you to generate about 100 PDFs a month. If you generate more you can continue to pay for the service.
Go to Settings > PDF and enter your PDF Rocket API key into the settings box.
-----
Older options below:
if the setting is html2ps then:
- go to Settings > Advanced and look for 'pdf_embed_font'
- change the option from 'none' to 'all' and save.
- Download this 16MB TTF file: http://unifoundry.com/unifont-5.1.20080907.ttf
- Rename the uncompressed "unifont-5.1.20080907.ttf" file to "arialuni.ttf"
- Using FTP, upload this new "arialuni.ttf" file to your UCM folder: includes/plugin_pdf/html2ps/fonts/ (if asked to overwrite the existing arialuni.ttf file choose YES)
- generate a PDF to test.
if the setting is mPDF then:
- Download this 16MB TTF file: http://unifoundry.com/unifont-5.1.20080907.ttf
- Rename the uncompressed "unifont-5.1.20080907.ttf" file to "arialuni.ttf"
- Using FTP, upload this new "arialuni.ttf" file to your UCM folder: includes/plugin_pdf/mpdf/ttfonts/ (if asked to overwrite the existing arialuni.ttf file choose YES)
- generate a PDF to test.
If the unicode character still do not display then you may need to edit the invoice_print template and set the font family to arialuni like this:
<span style="font-family:arialuni;">Your Unicode Text Here</span>
or by modifying the template <style> tag and setting the body font family like this:
<style type="text/css">
body{
font-family: arialuni;
}
</style>
Alternatively please try the mPDF instructions listed here: http://mpdf1.com/manual/index.php?tid=453