Copy link to clipboard
Copied
Hi folks,
I'm using the CFDocument tag to create a PDF from a block of HTML. There are images in this block, and everything works well, including some inline CSS formatting directiongs, until I include:
#featured img {
float: left;
margin: 0 15px 0 0;
}
To allow my text to appear to the right of my images on every row. This formatting works fine in the HTML version, but as soon as I wrap it with my CFDocument tags, the images vanish.
I'm willing to believe that there may be a larger spacing issue or CSS problem that I've not yet discovered that is causing this problem, but have not yet found it. I felt I would post here and ask if there were any known issues (that I could not find in a search of available forum topics) wherein the CFDocument tag fails to display images when using the float CSS directive.
Thanks!
Charlie
Copy link to clipboard
Copied
Hi,
When you call the images inside your CFDOCUMENT its taking lot of time for Process, at the end the user will get frustrated.
Try to include all your styles and process the content in CFSAVECONTENT tag and use this variable.
It helped me.
<CFSAVECONTENT variable = test>
<table style="margin-bottom: 0%" width="150%" >
<tr>
<td class=rtitle>Corrective Actions Summary</td>
<td class=orgid align=right><img style="vertical-align: text-bottom" alt=Honeywell
src="<cfoutput>#Request.root#feedback/images/small.gif</cfoutput>"
border=0></td>
</tr>
<tr>
<td style="height: 1px; background-color: black" colspan=2></td>
</tr>
</table>
</CFSAVECONTENT>
<CFDOCUMENT format = "pdf">
<cfoutput>#test#</cfoutput>
</CFDOCUMENT>
Copy link to clipboard
Copied
Thank you for the tip - much appreciated!