Status/Resolution/Reason: Closed/Withdrawn/DesignLimitation
Reporter/Name(from Bugbase): Tim Brown / Tim Brown (Tim Brown)
Created: 01/27/2015
Components: Document Management
Versions: 11.0
Failure Type:
Found In Build/Fixed In Build: CF11_Final /
Priority/Frequency: Major / All users will encounter
Locale/System: ALL / Platforms All
Vote Count: 9
Problem Description:
If you try to use HTML inside the <cfhtmltopdfitem> type of header or footer it throws an error stating an illegal element is encountered. This definitely seems like an oversight as many who would love to migrate from cfdocument to <cfhtmltopdf> would encounter this extreme limitation of not being able to output HTML in the header and footer as well as
Steps to Reproduce:
1. Attempt to output any
<cfset stFooter = {
"PrintFooterHTML" = "<h5>Some HTML for footer</h5>",
}>
<cfhtmltopdf overwrite="true" name="variables.pdfFile" destination="#variables.myDestinationPath#" margintop=".5" marginLeft=".5" marginRight=".5" >
<h1> My Document text here</h1>
<p>... lots of content....</p>
<cfhtmltopdfitem type="footer" attributecollection="#stFooter#">
<div style="text-align:right; margin-bottom:10px;">
#attributes.PrintFooterHTML#
</div>
</cfhtmltopdfitem>
</cfhtmltopdf>
**********************************************************************************************
ALSO you can no longer do conditionals based on normal page or last page by comparison of the current page vs total page count as you can in cfdocument
**********************************************************************************************
<cfif cfdocument.totalpagecount EQ cfdocument.currentpagenumber>
... different html for last page ...
<cfelse>
... different html for all other footers ....
</cfif>
**********************************************************************************************
**********************************************************************************************
<cfif _PAGENUMBER EQ _LASTPAGENUMBER>
<img src="#attributes.lastPageFooterImg#" />
<cfelse>
<img src="#attributes.normalFooterImg#" /> etc...
</cfif>
**********************************************************************************************
Actual Result:
**see attached for full stack trace **
EXCEPTION -> Message internalProcessElement: InvalidInput: Illegal element tag "div"
StackTrace com.adobe.internal.afml.AFMLExceptionInvalidParameter: internalProcessElement: InvalidInput: Illegal element tag "div" at com.adobe.internal.afml.AFMLAnomalies.AFMLInvalidParameterStop(AFMLAnomalies.java:76) at com.adobe.internal.pdftoolkit.services.xfatext.FormatXFAText.internalProcessElement(FormatXFAText.java:2863) at
Expected Result:
To render the HTML in the footer or header of each page vs a monospaced font/text only option like currently the result as only basic variables can be supplied and output. This seems to be a major limitation especially since the tag has the word HTML in the name.
Any Workarounds:
I could potentially generate an image based on the dynamic html of a cfsavecontent but this still doesn't allow me to do conditional logic to supply a different image based on something to the effect of <cfif _PAGENUMBER EQ _LASTPAGENUMBER> <img src="#attributes.lastPageFooterImg#" /> <cfelse> <img src="#attributes.normalFooterImg#" /> etc... </cfif>
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3928680
External Customer Info:
External Company:
External Customer Name: Tim
External Customer Email:
External Test Config: My Hardware and Environment details: Windows 2008 R2 with IIS CF 11 update 3 -> this would likely affect all platforms regardless of web server or browser.
Attachments:
- January 28, 2015 00:00:00: 1_cf11_cfhtmltopdfitem_bug_noHTMLAllowed.txt
Comments: