Error in Draw image on PDF using Zend Framework in

2019-05-28 16:33发布

问题:

I am working on create a catalog PDF in Magento-2 using Zend Framework. My code is here to print catalog image on PDF.

foreach ($collection as $product) 
    {
    $image = $product->getImage();
    $path =  $mediaUrl."catalog/product".$image;
    $imagef = Zend_Pdf_Image::imageWithPath($path);
    // write image to page
    $page->drawImage($imagef, 50, 50, 400, 400);
    }

But it did not work for me.