kobena Posted April 22, 2011 Share Posted April 22, 2011 Hello all i am using PDFlib GmbH Version 7.0.4p4. When i run the scrip pdf_invoice3.php, i get the error: "A pdflib exception occured:Handle parameter or option of type 'image' has bad value 0". Does anyone understand what that means and how to correct it? Php version 5.3.1 Mysql version 5.1.41 xammp 1.7.3 windows OS Link to comment Share on other sites More sharing options...
Larry Posted April 22, 2011 Share Posted April 22, 2011 Is there a line number associated with the error? Link to comment Share on other sites More sharing options...
kobena Posted April 22, 2011 Author Share Posted April 22, 2011 Is there a line number associated with the error? Larry, Thanks for the reply. There is no line number associated with the error. This is strange to me. The new thing introduced is the image so i believe will be a problem with either the fit_image function or the load_image function. Link to comment Share on other sites More sharing options...
kobena Posted April 25, 2011 Author Share Posted April 25, 2011 Hello all, I solved the problem by doing two (2) things: 1. Although, i had "logo.png" in the same directory as the script "pdf_invoice3.php", i got results by providing the full path: so change $image=$pdf->load_mage('auto','logo.png',NULL); to $image=$pdf->load_mage('auto','/path/logo.png',NULL); eg $image=$pdf->load_mage('auto','D:/xampp/htdocs/advance/bonus/logo.png',NULL); 2. Change the argument in the fit image function by deleting the first "0.0": so change $pdf->fit_image(0.0,$image,(INCH/2),(PAGE_HEIGHT-(INCH/2)-$h),"scale $scale"); to $pdf->fit_image($image,(INCH/2),(PAGE_HEIGHT-(INCH/2)-$h),"scale $scale"); Hope this helps someone. 1 Link to comment Share on other sites More sharing options...
Larry Posted April 25, 2011 Share Posted April 25, 2011 Kudos for figuring it out and thanks for sharing your solution! Link to comment Share on other sites More sharing options...
Recommended Posts