Issue Type: Bug Created: 2008-01-06T00:41:53.000+0000 Last Updated: 2008-03-31T16:12:00.000+0000 Status: Resolved Fix version(s): - 1.5.0 (17/Mar/08)
Reporter: Gary Martellino (gmartellino) Assignee: Alexander Veremyev (alexander) Tags: - Zend_Pdf
Related issues: Attachments: - Adobe-PDF-Output.jpg
I followed the tutorial by Alexander Veremyev and it seems that drawText() will not work on a Sun Solaris server. I tested the identical code on my local windows machine and it worked fine. The output PDF is blank; however, when you view the properties of the document, you can see the information on the specified font, but no text renders. The following is the code I'm testing:
<pre class="highlight"> <?php require_once 'Zend/Pdf.php'; // Create new PDF $pdf = new Zend_Pdf(); // Add new page to the document $page = $pdf->newPage(Zend_Pdf_Page::SIZE_LETTER); $pdf->pages = $page; //set font $font = Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA); $page->setFont($font, 24); $page->drawText('Hello world!', 25, 750); $pdfData = $pdf->render(); //store a date stamp and use it in the file name of the pdf when the report outputs to the browser $date_stamp = date("Y-m-d_g-i_a"); header("Content-type: application/x-pdf"); header("Content-Disposition: inline; filename=PurgeReport_$date_stamp.pdf"); echo $pdfData; ?>
It fails both with fontWithName and fontWithPath.
Posted by Gary Martellino (gmartellino) on 2008-01-06T00:56:37.000+0000
This file shows the blank file with no text, but the font properties of the document showing the correct font. No text was drawn on the page with drawText(). This same PDF outputed correctly from a windows based machine.
Posted by Gary Martellino (gmartellino) on 2008-01-07T12:40:48.000+0000
ZF-2387 Should be disregarded as it duplicates the issue in ZF-588. The problem actually existed within the iconv extentions implementation across a couple servers in our organization. Sorry for the confusion.
Posted by Alexander Veremyev (alexander) on 2008-02-01T10:27:56.000+0000
ZF-588 is actually another issue.
The problem, described in the ZF-588 appears only with '€' symbol
Posted by Alexander Veremyev (alexander) on 2008-02-01T10:29:00.000+0000
Gary, could I ask you to attach generated PDF to the issue? It may help a lot.
Posted by Gary Martellino (gmartellino) on 2008-02-01T11:59:32.000+0000
Hi Alexander, the problem actually had to do with the iconv extension in our PHP installation. Being that the character encoding was not found, it silently dropped all the characters it was trying to draw using drawText(). The framework method works as its supposed to and there is no actual issue. Once I found that our iconv was at fault everything came together. Thank you for your response.
Posted by Alexander Veremyev (alexander) on 2008-02-01T17:05:55.000+0000
Good! I think that may be a common problem for Zend_Pdf and other ZF components and should be mentioned somewhere in the documentation... Thanks for the info!
Posted by Wil Sinclair (wil) on 2008-03-31T16:12:00.000+0000
Please evaluate and categorize as necessary.
Have you found an issue?
See the Overview section for more details.