Jump to content

PDF generation with Cyrillic symbols


Recommended Posts

Hello,

First of all, forgive me if everybody's sick already with this topic which seems to be discussed all the time. I did use the search engine and I did read pretty much everything on the matter (plus the posts tagged as solved)...

However I seem to be incapable of completing the task correctly and I cannot make my website (1.1.0.5 ) generate PDFs with Cyrillic symbols. I followed the steps in this post and in several other ones (I don't know if I did everything right, because I don't know Russian very well).

I thought I'd share what I've tried. Sorry if I made a stupid mistake, but I don't fully understand how this PDF generating works. Please tell me if I'm doing something wrong.

What I did was the following:
1. I went to http://fpdf.fruit-lab.de and uploaded this font which should support the necessary symbols. I used cp1251 map and didn't customize it.
2. I removed the .txt extension from the *.php file and uploaded all four files to "./tools/fpdf/font/".
3. I changed the function in PDF.php with the code from here and replaced the file in "classes" dir.
4. Finally, I set up the encoding to cp1251 and the font to the newly created one in Preferences -> PDF

I've played with different fonts and bits of code but the result is always negative.

Please help if you know how this can be solved. I would appreciate any help that you could provide.

Link to comment
Share on other sites

  • 1 year later...

Hi,

I'm not sure, but read this answer :

You must change the text encode in [root]/classes/PDF.php directly.
The encode method is call for all text like this :

Tools::iconv('utf-8', self::encoding(), 'my text')



Just change utf-8 to your cp1251

Best regards

Link to comment
Share on other sites

I set PrestaShop on WAMP on my laptop.
I saw in fpdf/makefonts are encoding files .map

.. another thing, i migrated from FPDF to TCPDF and there is the same problem,

TCPDF ERROR: Could not include font definition file: f1398de3899c0d6eddefe53443e2b2da_arial

Link to comment
Share on other sites

×
×
  • Create New...