Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-03-2008, 10:39 PM
Junior Member
 
Join Date: Jan 2008
Posts: 3
Question Zend_PDF drawText() problem

I've followed the Zend_PDF tutorial that's on the Zend Developer Zone; however, I cannot get drawText() to work. The font file I specify seems to be embedded within the pdf, but the text does not render. All I get are blank pages and the text doesn't show up (I can draw shapes and other things no problem though)

I'm working off a Sun Solaris server, so I'm not sure if the glyphcodes described in the Zend_PDF_Font classes have something to do with why the text won't show up? Please let me know if you have any insight to this problem, I've just about exhausted everything I can think of.

Thanks in advance,
Gary
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-04-2008, 04:22 PM
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-07-2008, 06:47 PM
Junior Member
 
Join Date: Jan 2008
Posts: 3
Default

I think I solved my own problem. Looks like it was actually an error in the configuration of the ICONV extension rather than something in the code itself.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 11:24 AM.