Jump to content

PDF problems


Recommended Posts

Hi,

I've installed TCPDF to PS1.1 to have PDF's in Lithuanian (iso-8859-4 or cp1257).
Everything seems to work fine and all diacritic characters appear ok except one annoying issue: one character 'š' is replaced by phrase 'š' (I believe this is HTML code for this caracter).

I've tried everything but cannot force tcpdf and ps to generate correct character in pdf. Maybe anyone had the same issue and came up with solution?

Mantas

Link to comment
Share on other sites

Hi, I dont really knows the solution but I found something on this link, maybe it can help you
http://www.prestashop.com/bug_tracker/view/629/

Anyway, how did you installed tcpdf ? I also have problems with the utf-8 fonts

I have tried the most solution I found in the seach, but most of the modify applies to the old prestashop. (I tried this link without sucess: http://www.prestashop.com/forums/viewthread/3480/P30/__/_lang____pdf)

So im still clueless about this matter.

Anyone have the whole pakage with (with all the config ready eg in pdf.php using tcpdf or uFPDF) of files for me to download?

Link to comment
Share on other sites

Hi,

I did everything according to directions I found in PrestaShop forum, and it worked fine for me. You just need to look carefuly to all changes in corresponding .php files, because a slight typing error stops tcpdf from working correctly.

Also I now see that in my thread the browser interprets text '& scaron ;' as a character 'š' (s with caron), so somehow tcpdf should do that too.

I'll ask for solution in tcpdf.org and if I'll have the answers I'll post them here.

Mantas

Link to comment
Share on other sites

  • 2 weeks later...

Hi,

I found a solution by erasing iconv function in classes/pdf.php

It seems that pdf.php converted text received from tcpdf in utf-8 to some other encoding which didn't recognized the diacritic character 'š'.

So I removed all iconv functions which looks like: Tools::iconv('utf-8', self::encoding(), $some string). Now prestashop generates pdf files perfectly with all diacritic and other special character.

Regards
Mantas

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...

Hi, I found the easier way, it is necessary to only change file \ classes \ Tools.php of line 785 in this way:

{
//Uncoment lines below to return to previous condition
//$converted = htmlentities($string, ENT_NOQUOTES, $from);
//$converted = html_entity_decode($converted, ENT_NOQUOTES, $to);
//return $converted;
//Delete line below to return on previous condition.
return $string;
}

And, voila character ‘š’ is there.

Tools.php

Link to comment
Share on other sites

×
×
  • Create New...