Hi all,
I have troubles using Zend Framework's PDF
When I create PDF file I need to use UTF-8 as encoding. This is the code I am using to generate simple pdf file. I always get this wrong displayed. Instead of seeing 'Faktúra' in pdf file, it gives me 'Faktú' Instead of seeing 'Dodávateľ:' in 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 load font from Windows directory
$font = Zend_Pdf_Font::fontWithPath('C:\WINDOWS\Fonts\TIMES.TTF');
But it gives me the error:
Fatal error: Uncaught exception 'Zend_Pdf_Exception' with message 'Insufficient data to read 2 bytes'
It is really driving me crazy and I believe some of you would have little hints for me:) Solving the error would be the best solution...
Thanks a lot in advance