News:

Looking for documentation? Take a look on our wiki

Main Menu

Pdf invoice in greek language is broken

Started by darkidas, September 16, 2013, 18:20:40 PM

Previous topic - Next topic

darkidas

Hi,
I am using Virtuemart 2.0.22d/joomla 2.5.14.
I have installed the greek language and when someone who uses the greek language make an order, the invoice pdf that is sent by email and also the pdf invoice in the backend are unreadable.
Instead of characters they are full of ?.
I guess it has to do with encoding. Any ideas on how to fix this?
Thank you in advance

Maxim Pishnyak

Check FAQs forum section - thread "UTF-8 support in PDF Invoice".
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

darkidas

Thanks for the reply,
I have already tried that fix but nothing happened. Tried it again same result. Also the section that Bytelord suggests to change is not there. Maybe this solution is for an older vm version than mine.
Any other suggestions would be appreciated

Maxim Pishnyak

What did you try to do? I saw two possible solutions for this issue.
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

darkidas

I have tried this:

Quote1. Download tcpdf from this link http://sourceforge.net/projects/tcpdf/
2. Take the fonts files included in the Fonts folder of the downloaded file and I copy them to the /libraries/tcpdf/fonts
3. Open /libraries/joomla/document/pdf/fonts.php and find the line where $pdf->SetFont is written (about line 221)
4. Replace the line with something like that $pdf->SetFont('freesans', '', 6, '', 'false');
5. Find "var $_header_font" and "var $_footer_font" (about lines 32 and 33) and replace the fonts there with freesans font:
   var $_header_font = 'freesans';
   var $_footer_font = 'freesans';

but it didnt work. I also replaced freesans with dejavusans. It didnt work either.

The suggestion of bytelord :
QuoteWhen order status updated from the backend or pdf invoice saved in safepath, controller runs a function that set the fonts again. So edit the file joomla_folder\components\com_virtuemart\controller\invoice.php

around lines 151, 152 change the font

$pdf->setHeaderFont(Array('freesans', '', 8 ));
$pdf->setFooterFont(Array('freesans', '', 10 ));

also around line 179, change also the font

$pdf->SetFont('freesans', '', 8, '', true);
I didnt find those lines of code in the file indicated.

Maxim Pishnyak

I'm not sure maybe it's possible to choose font in invoice setup (VM Vendor config)?
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

darkidas

Hmm using a unicode font from inside vm config as you suggested helped a lot. I at least got rid of the annoying ? . The core text is not translated though its in english and only user input is shown at greek. But for now i am ok with that  :)
Thanks for your help and lets hope i will not need you again on that subject.

Maxim Pishnyak

You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart