php - Zend pdf errors with function Image drawing -
i want put image pdf file code function in zend simple example here http://framework.zend.com/manual/1.12/en/zend.pdf.drawing.html , code
$image = zend_pdf_image::imagewithpath("' . $base . '/images/logo1.png"); $page->drawimage($image, 100, 100, 400, 300); // add page document $pdf->pages[] = $page; $pdf->save("data/reports/-report.pdf");
but errors
pdf error: cannot create image resource. file not found.
any it.
your including single quotes inside file name.
$image = zend_pdf_image::imagewithpath("' . $base . '/images/logo1.png");
change reads
$image = zend_pdf_image::imagewithpath($base . "/images/logo1.png");
Comments
Post a Comment