0

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)

1 Answer 1

4

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.

6
  • Ok I didn't notice that. So I have to increase resolution of my images to 300dpi ?
    – MatTheCat
    Oct 14, 2010 at 21:54
  • 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
    Oct 14, 2010 at 22:01
  • 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
    Oct 15, 2010 at 7:38
  • can you improve the quality of the source image?
    – robjmills
    Oct 15, 2010 at 10:25
  • Even if I create 300dpi image it appears pixilated on the pdf.
    – MatTheCat
    Oct 15, 2010 at 12:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.