- Impact
- 38
Hey,
Using Zend for pdf generation, which is all working fine and dandy.
However, I wish to include an image in the pdf which is user uploaded.
The upload works fine. Inserting the image into the PDF is fine.
My problem is, I want the image to be its original size, without forcing a fixed area for the image to 'fill'.
As it stands Zend_Pdf stretches the image to fill the area, or shrinks it to do so.
What I want is the image to stay at its real dimensions.
Currently I am using:
The logo.jpg file is in reality 334 x 112. Which may vary depending on the users own logo.
What I am asking is, is there any way to get the dimensions of $image directly using Zend? Or am I going to have to use GD, if so, how would it be done using GD? (not used images in this way before)
Thanks for any help.
Using Zend for pdf generation, which is all working fine and dandy.
However, I wish to include an image in the pdf which is user uploaded.
The upload works fine. Inserting the image into the PDF is fine.
My problem is, I want the image to be its original size, without forcing a fixed area for the image to 'fill'.
As it stands Zend_Pdf stretches the image to fill the area, or shrinks it to do so.
What I want is the image to stay at its real dimensions.
Currently I am using:
PHP:
// Draw Logo
$imagePath = "../users/".$this->user."/logo.jpg";
$image = Zend_Pdf_Image::imageWithPath($imagePath);
$page->drawImage($image, 50, 720, 400, 860);
The logo.jpg file is in reality 334 x 112. Which may vary depending on the users own logo.
What I am asking is, is there any way to get the dimensions of $image directly using Zend? Or am I going to have to use GD, if so, how would it be done using GD? (not used images in this way before)
Thanks for any help.





