-->
Welcome, Guest
Username: Password: Remember me

TOPIC: PDF in Hebrew

PDF in Hebrew 2 years 9 months ago #29843

  • remiblum
  • remiblum's Avatar
  • OFFLINE
  • Newcomer
  • Posts: 4
  • Karma: 0
Hello,
I am using the Dolibarr 5.0 for a association in Israel and changed all the collations to utf-8 so Hebrew characters are displayed.
I have a new issue with PDF documents (in service proposal for example), the Hebrew characters are replaced by ????
How can I solve this problem?

Great software!!
The administrator has disabled public write access.

PDF in Hebrew 2 years 9 months ago #29849

  • remiblum
  • remiblum's Avatar
  • OFFLINE
  • Newcomer
  • Posts: 4
  • Karma: 0
Precision: I tried the method described here without success (I used freesansb.ctg.z in FONTFORPDF=freesansb.ctg.z and updated the font folder).
In my 5.0 version of Dolibarr, the path is not /includes/tcpdf/fonts/ but /htdocs/includes/tecnickcom/tcpdf/fonts

Q: My PDF template doesn't understand foreign characters, it outputs them as ???

This is probably a font problem, the current font used for generating the PDF cannot handle the foreign characters you are trying to print. So just try to use another set of font.
You will find the fonts used by Dolibarr to print PDF inside your Dolibarr folder.../includes/tcpdf/fonts/
To change the font used for generating PDF, you need to edit the 'main.lang' file of the language you are using (you'll find the file in your Dolibarr.../langs/en_US/main.lang for instance if you use English)
Edit the main.lang file
Locate the constant FONTFORPDF at the beginning of the file and change the value to FONTFORPDF=dejavusans for instance if you want to use dejavusans. Please note that sometimes FONTFORPDF may be missing, in this case you should add it at the beginning of the file.
Save the file and try again to generate your PDF.
If you are unlucky, you can try with more fonts, just go to the TCPDF website sourceforge.net/projects/tcpdf/files/ and download the latest zip package. Then extract only the 'fonts' folder from the zip. Then copy the files in your Dolibarr installation .../includes/tcpdf/fonts/ so you will get more fonts to play with.
The administrator has disabled public write access.
Time to create page: 0.058 seconds