I am using ColdFusion 10 Enterprise edition, and am unable to display images when using CFDOCUMENT
to generate a PDF. Below is the piece of code I am using:
<cfsavecontent variable="report">
<table align='center'>
<cfoutput query="VARIABLES.result">
<tr>
<td>
<div class='addInfoDetails'>#SHOWINFO#</div>
</td>
</tr>
</cfoutput>
</table>
</cfsavecontent>
In the above code, the VARIABLES.result
query is coming from database and SHOWINFO
is a variable having the content of image and text. For example:
SHOWINFO =
"<p> Hi This is the test information
<img alt="image" src="../TestBank/test/info/5KQ.jpg"/>
</p>"
Here if dump the SHOWINFO
variable inside the CFSAVECONTENT
, the image displays correctly. But when I convert this into PDF, using CFDOCUMENT, the image is not displaying.
Below is the code block I am using to generate the pdf:
<cfdocument format="PDF" saveasname="TestPDF">
<cfoutput>#report#</cfoutput>
</cfdocument>
Thanks in advance.
I fixed it by adding the attribute "localUrl = yes"
in CFDOCUMENT tag.
Now it is working fine for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With