Status/Resolution/Reason: Closed/Won't Fix/LowImpact
Reporter/Name(from Bugbase): Igor Ilyinsky / Igor Ilyinsky (cccfug)
Created: 05/31/2012
Components: CFPRINT
Versions: 9.0.1
Failure Type:
Found In Build/Fixed In Build: 9.0.1 /
Priority/Frequency: Major / Most users will encounter
Locale/System: English / Win 2008 Server
Vote Count: 2
Problem Description:
Background images are ignored in CFDOCUMENT calls when inside a loop.
Steps to Reproduce:
<CFSET PAGEARRAY = [] /> <CFLOOP from="1" to="3" index="i"> <CFDOCUMENT FORMAT="PDF" NAME="PDFPAGE"> <html><body><div style="background:url(http://www.houseoffusion.com/_/hof120.gif)"><BR> </div></body></html>; </CFDOCUMENT> <cfset arrayappend(PAGEARRAY,PDFPAGE) /> </CFLOOP> <CFDOCUMENT FORMAT="PDF" NAME="PDFPAGE"> <html><body><div style="background:url(http://www.houseoffusion.com/_/hof120.gif)"><BR> </div></body></html>; </CFDOCUMENT> <cfset arrayappend(PAGEARRAY,PDFPAGE) /> <CFPDF action="merge" name="FINALPDF"> <cfloop from="1" to="#arraylen(PAGEARRAY)#" index="i"> <cfset pointer = PAGEARRAY[i]/> <cfpdfparam source="pointer"> </cfloop> </CFPDF> <cfcontent type="application/pdf" variable="#tobinary(FINALPDF)#">
If you run this (on CF8 or CF9 - not tried 10) you will notice that the image appears only on the first and last page! Why? Because CFDocument ignores background images after the first call when in a loop. I was able to prove this by putting the call into a CFINCLUDE inside the loop. But then, if you add a CFDOCUMENTITEM to it, it throws an error: "Routines cannot be declared more than once". According to Adobe there was a hotfix for this in CF8, although it did not work for me.
Actual Result:
PDF without images
Expected Result:
PDF with images
Any Workarounds:
Use CFINCLUDE, but using a CFDOCuMENTITEM throws error: "Routines cannot be declared more than once"
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3202782
Deployment Phase: Release Candidate
External Customer Info:
External Company:
External Customer Name: cccfug
External Customer Email:
External Test Config: My Hardware and Environment details:
Attachments:
Comments: