Title:
[ANeff] Bug for: cfhtmltopdf/cfpdf are not yet a replacement for cfdocument
| View in TrackerStatus/Resolution/Reason: To Track//NeedMoreInfo
Reporter/Name(from Bugbase): Aaron Neff / Aaron Neff (Aaron Neff)
Created: 04/26/2016
Components: Document Management
Versions: 11.0
Failure Type:
Found In Build/Fixed In Build: CF2016_Final /
Priority/Frequency: Major / Most users will encounter
Locale/System: English / Platforms All
Vote Count: 4
Issue: cfhtmltopdf/cfpdf are not yet a replacement for cfdocument
The following cfhtmltopdf code should run, but doesn't b/c cfhtmltopdf is not yet a replacement for cfdocument:
<cfhtmltopdf bookmark="yes" destination="#expandPath('./CFHTMLToPDF.pdf')#" overwrite="yes">
<cfhtmltopdfitem type="header" evalatprint="yes">
<cfoutput><div style="text-align:#CFHTMLTOPDF.currentSectionPageNumber mod 2?'left':'right'#;">Page #CFHTMLTOPDF.currentSectionPageNumber# of #CFHTMLTOPDF.totalSectionPageCount#</div></cfoutput>
</cfhtmltopdfitem>
<cfhtmltopdfsection name="Section 1">
<cfoutput>#repeatString('Section 1 ', 1000)#</cfoutput>
</cfhtmltopdfsection>
<cfhtmltopdfsection name="Section 2">
<cfoutput>#repeatString('Section 2 ', 1000)#</cfoutput>
</cfhtmltopdfsection>
</cfhtmltopdf>
The following, equivalent, cfdocument code runs fine:
<cfdocument format="pdf" bookmark="yes" filename="#expandPath('./CFDocument.pdf')#" overwrite="yes">
<cfdocumentitem type="header" evalatprint="yes">
<cfoutput><div style="text-align:#CFDOCUMENT.currentSectionPageNumber mod 2?'left':'right'#;">Page #CFDOCUMENT.currentSectionPageNumber# of #CFDOCUMENT.totalSectionPageCount#</div></cfoutput>
</cfdocumentitem>
<cfdocumentsection name="Section 1">
<cfoutput>#repeatString('Section 1 ', 1000)#</cfoutput>
</cfdocumentsection>
<cfdocumentsection name="Section 2">
<cfoutput>#repeatString('Section 2 ', 1000)#</cfoutput>
</cfdocumentsection>
</cfdocument>
While cfpdf supports adding a header/footer, it only supports 5 HTML tags body,p,b,i,span. So, there's no workaround for other HTML tags.
While cfpdf supports DDX (for bookmarks), it requires writing each of the sections to disk as separate PDFs and then reading them back in. So, it's more code and disk I/O.
While Acrobat doesn't support conditional expressions in header/footer, cfhtmltopdfitem still needs an evalAtPrint attribute (ex: to left-align header on odd pages and right-align header on even pages, or display a different footer image on the last page). So, there's no workaround. This needs to be sorted out and not written-off as a "DesignLimitation".
cfdocument had rendering issues which cfhtmltopdf resolved, but to the detriment that much cfdocument code cannot be ported to cfhtmltopdf/cfpdf (and cfhtmltopdf cannot even be used in new code w/o considering the above limitations).
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 4145441
External Customer Info:
External Company:
External Customer Name: Aaron Neff
External Customer Email:
Attachments:
Comments: