I have an issue with a server to server call with ColdFusion.
Suppose I have two servers, each with a file:
www.Content.com/webpage.cfm
www.Badge.com/badge.jpg
My source code looks like this:
<cfdocument format="pdf" pagewidth="11" pageheight="8.5">
This is a simple PDF that was created to show issues with content generation on the server. This PDF uses an http:// reference to the badge server to show an image of a badged team member.
<BR />
<BR />
<img src="https://www.badge.com/badge.jpg" />
</cfdocument>
If I remove the CFDOCUMENT tags, the page renders perfectly and the JPG image shows exactly as it should. However, when I render the page as a PDF, the document does not include the JPG file and a large, ugly red X appears where the image otherwise should.
My web administrator has suggested that although the user may authenticate on badge and on content, the badge server might not authenticate to content or vice versa. How can I instruct coldfusion to take the user permissions from the currently logged in user and to pull the image?
I looked into using CFIMAGE and saving the image file into contents RAM, then writing the image to a variable before the PDF renders. That seems to generate a bug.
Thank you in advance for your feedback.
Is the image always different? otherwise, you may want to save the image on your server locally, and use attribute
localURL
http://www.ravenglass.com/blog/index.cfm/2010/6/9/Including-Images-in-a-PDF-created-in-CFDOCUMENT
Another possibility might be the SSL not being 'trusted' by CF. You can try fetching that image URL using CFHTTP and you will know if that's the case. see: Coldfusion: CFHTTP with SSL encrypted Page (https://) - got an error