imagepdfcoldfusionitextcfpdf

Sizing image problem in PDF whis iText or cfPDF in Coldfusion 8


WHen I insert a Image into a existing PDF whis CFPDF or directely whis iText, the size of my image is increased by 1.5.

How to control the image size?

my code are inspired from:
Adding a dynamic image to a PDF using ColdFusion and iText


Solution

  • If you are doing a catalogue type PDF it will be best to ensure your images are manually sized in the cfml to a certain height and width.

    I have printed tons of images in Coldfusion into a pdf before and come across a few things, you might have one of the following:

    1) Image resolution is higher than screen. I had a case, a while ago that the image was set to 300 dpi and the document wasn't. It was with a third party PDF creator however.

    2) You might want to check the resolution of the pdf you're printing to (whether it's screen (72 dpi) vs. print (150+ dpi)) and see if there's something there.

    3) If you can, size the images manually to have a maximum