View Single Post
  #2 (permalink)  
Old 01-04-2008, 04:22 PM
gmartellino gmartellino is offline
Junior Member
 
Join Date: Jan 2008
Posts: 3
Default

I just wanted to clarify a few things i may have left out in my orginial post. I am using Zend Framework 1.0.3. Also, here is the code I'm using to try to generate the PDF.

PHP Code:
// 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::fontWithPath('/path/to/TimesNewRoman.ttf');
$page->setFont($font32);
                
$page->drawText('Hello world!'100100);
$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

Last edited by gmartellino : 01-04-2008 at 05:19 PM. Reason: added comments to php code
Reply With Quote