I'm having problems using Zend Framework PDF
When I create a PDF file, I need to use UTF-8 as the encoding. This is the code that I use to create a simple pdf file. I am always mistaken. Instead of seeing “Faktúra” in a pdf file, he gives me “Faktú” Instead of seeing “Dodávate”: in a pdf file, it gives me “Dodáva"
$pdf = new Zend_Pdf();
$pdf->pages[] = ($page1 = $pdf->newPage('A4'));
$font = Zend_Pdf_Font::fontWithPath('C:\WINDOWS\Fonts\TIMES.TTF');
$page1->setFont($font, 20);
$page1->drawText('Faktúra', 40, 803, 'UTF-8');
$page1->drawText('Dodaváteľ:', $width_left, $height, 'UTF-8');
So, I tried to download the font from the Windows directory
$font = Zend_Pdf_Font::fontWithPath('C:\WINDOWS\Fonts\TIMES.TTF');
But this gives me an error:
Fatal error: exception for the exception 'Zend_Pdf_Exception' with the message 'Not enough data to read 2 bytes'
It really drives me crazy, and I believe that some of you will have little tips for me :) Solving the error would be the best solution ...
user72526