Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.3.3

Bug #9595 Font file typos
Submitted: 2006-12-11 01:14 UTC
From: atex at php dot net Assigned: yunosh
Status: Closed Package: File_PDF (version 0.1.0)
PHP Version: 5.2.0 RC4 OS: Linux
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 33 - 3 = ?

 
 [2006-12-11 01:14 UTC] atex at php dot net (Andrew Teixeira)
Description: ------------ When trying to use the getStringWidth() method on a string with a ',' (comma) in it, I sometimes get the following error: Notice: Undefined index: , in /usr/lib/php/File/PDF.php on line 1127 It seems that the ',' character's width cannot be determined. Test script: --------------- I have tried to use the following test script: error_reporting(E_ALL); require_once 'File/PDF.php'; $options = array('orientation' => 'P', 'unit' => 'pt', 'format' => 'Letter'); $pdf =& File_PDF::factory($options); $pdf->addPage(); $pdf->aliasNbPages(); $text = 'hello, goodbye, hello again'; $size = $pdf->getStringWidth($text); $pdf->setFont('Times', NULL, 12); $pdf->cell($size, 0, $text, 'R', 0, 'L', 0); $pdf_len = strlen($pdf->getOutput()); header('Cache-Control: no-cache'); header('Pragma: no-cache'); header("Content-Length: " . pdf_len); $pdf->output('file_pdf_test.pdf', true); However, I cannot force the error to appear. The problem, however, appears to come from the fact that the ',' entry in the arrays in the php files in the fonts/ directory for many of the fonts are as follows: ', ' => 250, The line-break and indentation seem to cause the problem as when I rewrite the line as: ',' => 250, I no longer have any issues. I have created a patch at the following URL: http://molior.mcs.suffolk.edu/patches/File_PDF-comma.patch.bz2 Expected result: ---------------- Correct generation of a PDF file. Actual result: -------------- Notice: Undefined index: , in /usr/lib/php/File/PDF.php on line 1127

Comments

 [2006-12-11 07:36 UTC] yunosh (Jan Schneider)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.