ZF-2387: drawText() fails on Solaris
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:
<?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.