I\'m using a script that generates a PNG image based on a URL parameter image_id
.
For example: http://www.example.com/image.php?image_id=G554jGTT
You cannot do this using Zend_Pdf_Image::imageWithPath
. The reason is that the ImageFacotry
expects a file. And it uses is_file
method to check if file exists. However, is_file
function does not necessarily work with remote files.
One way to overcome this problem would be to download the image and save it under temporary name, and this temporary file then put into Zend_Pdf_Image::imageWithPath
. To download and save the file, you could use, e.g. file_put_contents('./tempname',file_get_contents($imagepath))
. Off course, the tempname should be random and it should be removed afterwards.