VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: mcmannehan2002 on November 21, 2016, 08:58:08 AM

Title: Solved by myself - Languages problem (thai) with invoice/delivery PDF
Post by: mcmannehan2002 on November 21, 2016, 08:58:08 AM
Hello together, i am new here. Hope someone can help, because i didn't found an answer for my problem:

I did change the font for PDF in the admin to Free Mono (UTF-8 Unicode), but my invoice and my delivery PDF
dosen't show the Thai letters. I only get a lot question marks.

I did search in the forum and found this:
https://forum.virtuemart.net/index.php?topic=99783.0 (https://forum.virtuemart.net/index.php?topic=99783.0)
http://forum.virtuemart.net/index.php?topic=99347.0 (http://forum.virtuemart.net/index.php?topic=99347.0)
but this is not the right stuff for Virtuemart 3.0

Any sugesstions, what to do?




Title: Re: Languages problem (thai) with invoice/delivery PDF
Post by: Studio 42 on November 21, 2016, 12:07:33 PM
Try to find a compatible PDF font
Here a link to convert any fonts http://www.xml-convert.com/en/convert-tff-font-to-afm-pfa-fpdf-tcpdf.
But sometime the font break
Title: Re: Languages problem (thai) with invoice/delivery PDF
Post by: Studio 42 on November 21, 2016, 14:42:56 PM
Have you copy the font in the librairies/tcpdf/font folder ?
Title: Re: Languages problem (thai) with invoice/delivery PDF
Post by: Studio 42 on November 21, 2016, 14:59:33 PM
Check this http://forum.virtuemart.net/index.php?topic=99347.0
Else try to change in \components\com_virtuemart\helpers\vmpdf.php
$this->setFontSubsetting(true);
to
$this->setFontSubsetting(false);

Another problem can be that the fonts are set in the HTML, so you need to add a jexit(); on the right view and check the used fonts, perhaps in the HTML another valid font is used. So your font is perhaps not used.
Title: Re: Solved by myself - Languages problem (thai) with invoice/delivery PDF
Post by: Milbo on November 23, 2016, 08:10:56 AM
Quote from: mcmannehan on November 22, 2016, 10:45:11 AM
Copy all the files (thsarabunnew.ctg.z, thsarabunnew.php, thsarabunnew.z) to /libraries/tcpdf/fonts

than change in components/com_virtuemart/helpers/vmpdf.php
at line 142 to
//$vmFont=$this->vendor->vendor_letter_font;
$vmFont='thsarabunnew';
May be there is another possibility to change the font, without a core hack, but this works fine.

Yes, just use the DROPDOWN ! There is no need to hack the core.
Title: Re: Solved by myself - Languages problem (thai) with invoice/delivery PDF
Post by: Milbo on November 24, 2016, 10:46:36 AM
You must also add the spec file, then you can use it in the list. But it can happen, that it does not work, when your server does not provide the function "glob"
Title: Re: Solved by myself - Languages problem (thai) with invoice/delivery PDF
Post by: Studio 42 on November 24, 2016, 11:53:49 AM
Hi,
I like the "solved by myself', next time i explain you nothing. The vonverter is working in my case, perhaps not for thai and i gave you the file to search for else you perhaps not solved it.
Thanks anyway to send another one, this can help in other cases.