Forum How do I...?

Printing an image as part of a PDF

cdb
Hello,

I'm using PrinceXML to generate a PDF from a template. The template has an image associated with it. The image appears to get scaled to larger than it's normal size (in the browser) when displayed in the PDF. I'm using ImageMagick to re-size the image in the template, but not in the PDF (yet).

Questions:

1.) What is the best approach to handle images, and maintain their dimensions and resolution when generating a PDF.

2.) Should I be using a 150dpi or 300dpi version of the image for the PDF (the PDF is for a "printable" version of the template)?

3.) Does PrinceXML use image metadata?

Thanks in advance.
mikeday
If you are using Prince 7.1, try applying "prince-image-resolution: normal" so that Prince will ignore the intrinsic resolution of the image, which browsers also ignore. This has been made the default for Prince 8.0.

You can use 150dpi or 300dpi, PDF files are resolution-independent, so it simply depends upon the quality of your printer and whether you have any size constraints, eg. if you wish to distribute PDF files by email.
cdb
That seems to have done the trick! Thanks for the speedy response.