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

jordanken22

  • Beginner
  • *
  • Posts: 1
Re: PDF Invoice - strange characters
« Reply #30 on: September 24, 2014, 08:25:51 am »
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

Good for you.  I've been having this issue for a long time now and tried getting a solution for it awhile back but failed.  Tried following every fix in this thread including deleting the invoices (though I was a bit hesitant at first but decided to since i had no other options left) but still not seeing any results.  Do you guys have any other links to help me out on this? Much appreciate any help.

rage76

  • Jr. Member
  • **
  • Posts: 152
Re: PDF Invoice - strange characters
« Reply #31 on: February 13, 2015, 20:20:27 pm »
I have tried everything in this thread. after changing invoice font frmo VM backend to UTF-8, it now shows a "square box" instead of the earlier "?"

font changed to "dejavusans"

where am I wrong?

Joomla 2.5.22
VM: 2.6

Garyk01

  • Beginner
  • *
  • Posts: 13
Re: PDF Invoice - strange characters
« Reply #32 on: March 28, 2015, 18:15:41 pm »
Thanks guys for you replies..
I achieved to resolve my problem following ondrejspilka instructions..
I will write the steps that I followed in a more clear way so that everyone can do the changes..

1. 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';

Everything is OK now...

Sofoklis
Hi!
To Russian and Ukrainian languages picked fonts:
Open file \libraries\joomla\document\pdf\pdf.php
find and change to
Code: [Select]
var $_header_font = 'dejavusans';
var $_footer_font = 'dejavusans';
Code: [Select]
$pdf->SetFont('dejavusanscondensed', '', 8, '', 'false');
Joomla 3.4.1 + VM 3.0.6.4

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9853
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: PDF Invoice - strange characters
« Reply #33 on: March 30, 2015, 02:47:52 am »
Actually I wonder why this hack is still necessary. There is an option in vendor pdf tab for the font, which affects also the header and footer font

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 ));

So maybe you hunt ghosts?
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Garyk01

  • Beginner
  • *
  • Posts: 13
Re: PDF Invoice - strange characters
« Reply #34 on: March 30, 2015, 23:05:48 pm »
Help me please!
In which file or in which tabs "Configuration" I should write this code?

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9853
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: PDF Invoice - strange characters
« Reply #35 on: March 31, 2015, 01:28:31 am »
You dont need to write any code. Open your shop config (not vm config) and edit the invoice settings there.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Garyk01

  • Beginner
  • *
  • Posts: 13
Re: PDF Invoice - strange characters
« Reply #36 on: March 31, 2015, 21:53:14 pm »
 Okay! For invoices - select the font: Virtuemart->Shop->tab Invoices/Emails -> Default Font = Free Mono (UTF-8 Unicode)

But only this hack (written above) helps when you export the item description in pdf. 
May be you have other variant for export in pdf?

rage76

  • Jr. Member
  • **
  • Posts: 152
Re: PDF Invoice - strange characters
« Reply #37 on: April 16, 2015, 18:35:04 pm »
Again, I am on Joomla 2.5.28 & VM 2.6 and I am clueless what I am doing wrong !!
Tried everything. Seems there is no solution to this? :(

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9853
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: PDF Invoice - strange characters
« Reply #38 on: April 17, 2015, 08:44:47 am »
What you do wrong is to read an old thread

"March 09, 2012" , this means that almost anything here is outdated. The problem is solved in vm2.6 and vm3. It is very likely that you have another problem.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

rage76

  • Jr. Member
  • **
  • Posts: 152
Re: PDF Invoice - strange characters
« Reply #39 on: April 23, 2015, 18:38:59 pm »
any suggestions on what I can try to set this right?

nick-gr

  • Beginner
  • *
  • Posts: 2
Re: PDF Invoice - strange characters
« Reply #40 on: November 10, 2015, 19:32:13 pm »
Actually I wonder why this hack is still necessary. There is an option in vendor pdf tab for the font, which affects also the header and footer font

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 ));

So maybe you hunt ghosts?
Hello, if I open shop settings->Invoice tab->appearance->default fonts there is no fonts, only Select an Option. Any idea how can I add fonts?

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9853
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: PDF Invoice - strange characters
« Reply #41 on: November 10, 2015, 20:57:00 pm »
When you updated all the time, you may did not get the fonts. download the last tcpdf installer http://dev.virtuemart.net/projects/tcpdf/files
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

WilfredP

  • Beginner
  • *
  • Posts: 5
  • A beginner
Re: PDF Invoice - strange characters
« Reply #42 on: August 05, 2016, 04:52:28 am »
Hi all, does any one get solution for this?

I'm using Joomla 3x and VM3, I tried:
1. Change pdf.php setfont
2. Change default font via backend
3. Clear safe path invoice

But traditional chinese character not showing up still. Hope to get solution. Thanks!