Ravichandran Jothi
Ravichandran Jothi

Reputation: 3066

How to display invoice pdf logo as full size in magento?

I have image with dimension of 961*210. I need to display this images in invoice pdf generation in full page(like banner image) on the top of the logo area.

What are the values I need to set for parameters(x1,y1,x2,y2) in insertLogo() function?.

 $page->drawImage($image, x1, y1, x2, y2);

I tried multiple values but I can't figured it out. please help me?. I need exact coordinates for full page image (like banner image).

Upvotes: 0

Views: 898

Answers (1)

Jonathan Hussey
Jonathan Hussey

Reputation: 1044

Ah the joys of Zend_Pdf. The parameters for the drawImage() method are as follows:

  • $image = image as created using

    $image = Zend_Pdf_Image::imageWithPath($path);

where path is the path to the desired image on the filesystem

  • $x1 = distance from the left of the page to the left of the image
  • $y1 = distance from the bottom of the page to the bottom of the image
  • $x2 = distance from the left of the page to the right of the image
  • $y2 = distance from the bottom of the page to the top of the image

Unfortunately working with PDF's is a very manual process, and you are just going to have to try different values until you get it right. Also remember print margins, you'll want to leave a bit of space for this.

Upvotes: 3

Related Questions