Author Topic: PDF Invoice - strange characters  (Read 25589 times)

tserts

  • Beginner
  • *
  • Posts: 16
Re: PDF Invoice - strange characters
« Reply #15 on: October 25, 2012, 22:45:36 pm »
Thanks again, tonight for some reason my net speeds are very slow and it's a pain to perform more tests, I did two test orders and I got NO pdf attached to mails and, to add insult to injury, my backend generated pdfs from the order list are now messed up as well (the usual question marks). I will look into that tomorrow, I have to clean caches, chown some files (I edit as root sometimes for speed along many sites and some folders are sensitive to ownership) and re-run the tests, on top of all that I have upgraded vm versions since posting the first post and I can't know if something else is causing this..

I will update tomorrow after making everything is as it should..

bytelord

  • Nikos
  • Global Moderator
  • Full Member
  • *
  • Posts: 2369
Re: PDF Invoice - strange characters
« Reply #16 on: October 26, 2012, 00:46:30 am »
Try with dejavusans both in vm admin and tcpdf

joomla_folder\components\com_virtuemart\controller\invoice.php around lines 151, 152 change the font

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

also around line 179, change also the font

$pdf->SetFont('dejavusans', '', 8, '', true);

------


libraries\joomla\document\pdf\pdf.php around lines 32 and 33

var $_header_font = 'dejavusans';
var $_footer_font = 'dejavusans';

around line 222
   $pdf->SetFont('dejavusans', '', 8, '', 'false');

Regards
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

tserts

  • Beginner
  • *
  • Posts: 16
Re: PDF Invoice - strange characters
« Reply #17 on: October 28, 2012, 21:42:22 pm »
Ok, I made all the above changes and my backend generated pdfs are once again OK, I still don't get attached pdfs Ι'm afraid during the last update some root-owned files (my bad) were not updated, I will wait for the next update which will happen after a chown -R and try again. I don't think there are other places to look into, those two files are where the problem is (one for the email attachments and one for the back end), but I will post as soon as I have a solid set of files by version.

tserts

  • Beginner
  • *
  • Posts: 16
Re: PDF Invoice - strange characters
« Reply #18 on: October 28, 2012, 21:59:35 pm »
Ok FIXED.

I had to change the "statuses to send  invoice" in configuration they were empty for some reason.

The attached pdf was as it should, perfectly readable.

Thanks a lot for your help Bytelord!!

autarh

  • Beginner
  • *
  • Posts: 17
Re: PDF Invoice - strange characters
« Reply #19 on: August 25, 2013, 22:23:08 pm »
problem after update to 2.0.22b

before update everything worked fine, after update same situation instead UTF8 characters i have "?" ... any solution ?

tserts

  • Beginner
  • *
  • Posts: 16
Re: PDF Invoice - strange characters
« Reply #20 on: September 27, 2013, 13:50:59 pm »
Same here with a new site for a client, the documents have changed, I can't even find the same fields...

Shop>invoices now has a default font selection menu but I have no available fonts to choose...


tserts

  • Beginner
  • *
  • Posts: 16
Re: PDF Invoice - strange characters
« Reply #21 on: September 27, 2013, 13:57:25 pm »
Must be here, in vmpdf.php, so if I could set it in the front end it should work..

Code: [Select]
$vmFont=$this->vendor->vendor_letter_font;
$this->SetFont($vmFont, '', $this->vendor->vendor_letter_font_size, '', 'false');                 
$this->setHeaderFont(Array($vmFont, '', $this->vendor->vendor_letter_header_font_size ));
$this->setFooterFont(Array($vmFont, '', $this->vendor->vendor_letter_footer_font_size ));

tserts

  • Beginner
  • *
  • Posts: 16
Re: PDF Invoice - strange characters
« Reply #22 on: September 27, 2013, 17:32:00 pm »
OK, fixed it.

After I messed it up beyond hope, I re-installed the newest component, then aio, then updated the tables. Magically, after all that, I had a UTF-8 font on the drop down menu on the backend, which, when selected, worked as it should, both front and back end.

BaidareW

  • Jr. Member
  • **
  • Posts: 111
Re: PDF Invoice - strange characters
« Reply #23 on: October 15, 2013, 21:45:38 pm »
Hello,

 downloaded fonts, changed pdf.php as described but my Lithuanian text in PDF is still with ?? characters when pressing in back end.

And I can't find fonts line in file \components\com_virtuemart\controller\invoice.php so maybe this is the problem ?

Using 2.0.22x version of virtuemart.

BaidareW

  • Jr. Member
  • **
  • Posts: 111
Re: PDF Invoice - strange characters
« Reply #24 on: October 22, 2013, 13:57:59 pm »
Any one :) ?

WebWorx

  • Beginner
  • *
  • Posts: 7
Re: PDF Invoice - strange characters
« Reply #25 on: November 19, 2013, 08:12:10 am »
Did anyone get this method to work on the newer version of VM? I am having problems with the PDF invoice and Hebrew... getting question marks to come up where it should say (in Hebrew) Name, Address, Date, City, State, etc. the data for the customer - ie. the actual name, address is in there but just the labels show up as ????.... I posted my issue here... and I tried the suggestions I have found on these threads with no success.... Here is the thread with more info - http://forum.virtuemart.net/index.php?topic=120243.msg409539#msg409539

dbcig2013

  • Beginner
  • *
  • Posts: 36
Re: PDF Invoice - strange characters
« Reply #26 on: December 22, 2013, 14:16:12 pm »

hi,

in my case ( japanese character) , this workaround does not work.

i correctly loaded the freesans font in joomla library, but it seems the modification of pdf.php ( /libraries/joomla/document/pdf/)   and invoice.php (components\com_virtuemart\controller\invoice.php) do not change the font in generated pdf file

if i have a look in the properties of generated invoice, the default font is not freesans as it should

nb: fonts.php does not exist. instead i have pdf.php

dbcig2013

  • Beginner
  • *
  • Posts: 36
Re: PDF Invoice - strange characters
« Reply #27 on: December 22, 2013, 14:50:28 pm »

hi,

in my case ( japanese character) , this workaround does not work.

i correctly loaded the freesans font in joomla library, but it seems the modification of pdf.php ( /libraries/joomla/document/pdf/)   and invoice.php (components\com_virtuemart\controller\invoice.php) do not change the font in generated pdf file

if i have a look in the properties of generated invoice, the default font is not freesans as it should

nb: fonts.php does not exist. instead i have pdf.php

[attachment cleanup by admin]

its4yougr

  • Beginner
  • *
  • Posts: 36
    • Κατασκευή ιστοσελίδων Θεσσαλονίκη - Web Design
  • VirtueMart Version: VM3
Re: PDF Invoice - strange characters
« Reply #28 on: September 19, 2014, 19:48:27 pm »
It works Great for me too.
Greek Characters
Joomla 2.5.24
VM 2.6.6

The only difference is that the file is pdf.php

Thanks a lot
Κατασκευή Ιστοσελίδων Θεσσαλονίκη - http://www.its4you.gr/
WebDesign Internet Marketing - http://www.webdesign-internetmarketing.com/

tzaris

  • Beginner
  • *
  • Posts: 1
  • Skype Name: tzaris
Re: PDF Invoice - strange characters
« Reply #29 on: September 23, 2014, 21:47:50 pm »
i tried a lot of times with the changes but i was still getting the question marks ??
i solved it by doing the most easy step , delete the invoices in the safe path and
i finally get to see greek characters.
Joomla 2.5.25
VM 2.6.6