Skip to main content
Inspiring
June 21, 2006
Question

Graphics in CFDOCUMENT

  • June 21, 2006
  • 1 reply
  • 385 views


I am using <cfdocument> for the first time cause this sounded easier than using activePDF to creat my pdf files, but this is not working too well. My graphics files are showing up blank (missing graphic box with X through it). WHen I run the same code in my browser, then browser version graphics shows up fine, but when I put <cfdocument> tags aorund the exact same code, the PDF does not display the graphic.

Here is my code:

<CFDOCUMENT format="pdf"
filename = "c:\websites\websitefolder\PDF\THIS.pdf"
OverWrite = "yes"
Margintop = "0.01"
MarginBOttom = "0.01">

<table width="550" border="1" cellspacing="0" cellpadding="0">
<tr>
<td><img src="US.gif" ></td>
<td> </td>
<td> </td>
</tr>
</table>

</CFDOCUMENT>

The US.gif graphic shows up as missing on the PDF even though when I run the code outside the <cfdocument> tag it shows up fine??? Also, the scritp runs really slow. Is there a mapping problem here or something??

Please help - I just spent $5,000 and MX7, and my CF 4.5 with activePDF works a lot better than this.

Also, I updated MX7 to 7.01 - do I need to add more hotfixes??

Thanks in advance!
    This topic has been closed for replies.

    1 reply

    Participant
    September 21, 2006
    Check these postings (provided by Lossed on another query on this forum). The last link provided a real winner solution for me (using SSL):

    The forum posting:
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=1&catid=3&threadid=1168109&highlight_key=y&keyword1=cfdocument

    One set of things to look at:
    http://tinyurl.com/rl8c5 (converts to this link below):
    http://coldfused.blogspot.com/2005/11/missing-images-in-cfdocument.html

    THE Solution for SSL issues (and possibly others):
    http://tinyurl.com/l9hm4
    http://mkruger.cfwebtools.com/index.cfm/2006/5/30/cfdocument.file
    It states use absolute file addressing to reference the graphics:
    e.g. <img src="file:///d:\mysite\images\myimage.jpg" width="50" height="60">
    Inspiring
    September 21, 2006
    I have used CFDOCUMENT successfully with graphics and all I used for the image path was:

    <img src="inventorymaint/images/#ImageName#" alt="" border="2">

    It works great. As you can see I also get the image name from a db and set it as a variable. You also said that it takes time for the page to display... I've noticed this as well and have decided that's due to the acrobat engine building the page internally. Not sure if that's it, but I feel it is.