Nida
Nida

Reputation: 1702

Issue with image url in magento

I have to generate pdf of product images using zend_PDF. I have tried the following code

 $path=$this->getImageUrl($_product) 

 $imagePath=$path;
 $image = Zend_Pdf_Image::imageWithPath($imagePath);
 $page->drawImage($image, 40,764,240, 820);

This does not work. Can any one help me how to give url of product images properly.

Upvotes: 1

Views: 1037

Answers (1)

Josua M C
Josua M C

Reputation: 3158

Your code is wrong. on this line.

$path = $this->getImageUrl($_product);

Try this the correct one:

$path = $_product->getImageUrl();

and see this reference link

Upvotes: 1

Related Questions