views:

37

answers:

1

Hi !

I've tried Zend PDF and it works pretty well but I have a troublesome problem : when I add an image to a page with drawImage() it always appears pixilated regardless position and dimensions. There's many lines I don't understand in the Zend images classes, has someone already encountered this problem? How can I fix this ?

(I cannot post my code today but it's very simple and I think my question is not specific)

Thanks in advance !

+3  A: 

Remember that PDF is inherently a print medium (300dpi and higher), while your average .jpg is intended for screen viewing (72-100dpi). If you don't supply source images with approximately the same resolution as the document you're inserting it into, the PDF display engine will have to do all kinds of scaling to make things fit. Once when you insert the image to stretch it out to the size you want, and then downscaling again to make the PDF fit on your screen.

Marc B
Ok I didn't notice that. So I have to increase resolution of my images to 300dpi ?
MatTheCat
Only if this PDF is intended to be printed out. A screen-res'd image intended for on-screen viewing shouldn't get munged too badly.
Marc B
Images must have good quality but even if I create 300dpi image it appears pixilated..! I can not use this solution if there is no way to improve the quality of images.
MatTheCat
can you improve the quality of the source image?
seengee
Even if I create 300dpi image it appears pixilated on the pdf.
MatTheCat
What sort of source image are you using? Perhaps PDFlib is using a low quality embedded thumbnail and not the main actual full-size image. Try importing a .png or .bmp version instead to see what happens.
Marc B