Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do you convert a TIF image into PDF within coldfusion
    text
    copied!<p>The closest I have been able to get is using this code</p> <pre><code>&lt;cfset Background = ImageNew("",1725,2625)&gt; &lt;cfimage source="#APPLICATION.config.serverpath#/ad1.tif" name="ad1"&gt; &lt;cfset height1 = ImageGetHeight(ad1)&gt; &lt;cfset width1 = ImageGetWidth(ad1)&gt; &lt;cfset resImage1 = ImageCopy(ad1,0,0, width1, height1)&gt; &lt;cfset ImagePaste(Background,resImage1,150,150)&gt; &lt;cfdocument format="pdf" pagetype="custom" pagewidth="5.75" pageheight="8.75" fontembed="no" name="temp" margintop="0" marginbottom="0" marginleft="0" marginright="0"&gt; &lt;div style="position:absolute; top:0; left:0; right:0; bottom:0; z-index:0;width:100%;height:100%;"&gt; &lt;cfimage action="writeToBrowser" source="#Background#" style="width:1740px; height: 2650px;"&gt; &lt;/cfdocument&gt; </code></pre> <p>This gets me very close to the exact duplicate of my TIF image, but for some reason the image is reduced by like 5 pixels on the width, and I cannot figure out why.</p> <p>A bit more details: The ad1.tif image is 1425x1125, the final pdf document that gets produced is 1725x2625. As you can see I use 5.75 x 8.75 inches on the cfdocument. This translates in the PDF document being 300DPI. When I load up the PDF document in photoshop it does state the document is in 300DPI.</p> <p>You might notice that the ImageNew uses 1725x2625 and the cfimage uses 1740x2625. If I matched the cfimage dimensions to the imagenew (which makes perfect sense), then you end up with having this white border on the top, right, and bottom. The image is still off by like 5 pixels on the width. So I am forced to make it a bit bigger to get rid of that white border. If I can just figure out why that image is 5 pixels off.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload