Question : Sizing images inside CFDOCUMENT pdf.

Hello,
I'm using cfdocument (CF8) to create a PDF that contains a png image. I'm using a custom pagetype because the size varies depending on the size of the image. I'm also explicitly setting the size inside the <img> tag. Here's a code snippet:
1:
2:
3:
4:
5:
6:
7:
8:
<cfimage action="info" source="maps/#MapImage#" structname="pngInfo" >

<cfset Height = pngInfo.height/300 >
<cfset Width = pngInfo.width/300>

<cfdocument format="pdf" filename="#mapno#.pdf" overwrite="yes" pagetype="custom" unit="in" pageheight="#Height#" pagewidth="#Width#">
	<img src="maps/#MapImage#" height="#pngInfo.height#" width="#pngInfo.width#" />


The problem is that the image is reduced in size when displayed in the PDF instead of being displayed at its original size.

Any ideas appreciated.

Answer : Sizing images inside CFDOCUMENT pdf.


I am googling to see if you can set the resolution of the PDF file (set the dpi in CFDOCUMENT), but I don't see that anywhere.  Seems like you cannot set the resolution.

I also read that it's optimal for your image to be 96 dpi for cfdocument.   That was just one person's observation.

My recommendation would be to lower the resolution of your image due to the limitation of cfdocument; it seems it cannot be set at the higher res.

Random Solutions  
 
programming4us programming4us