tracker issue : CF-4145441

select a category, or use search below
(searches all categories and all time range)
Title:

[ANeff] Bug for: cfhtmltopdf/cfpdf are not yet a replacement for cfdocument

| View in Tracker

Status/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:

Related tickets: CF-3928680, CF-3931678, CF-3931673.
Comment by External U.
3017 | April 26, 2016 06:32:21 PM GMT
The bug #CF-3931678 has been taken up. But since it requires language changes, we will take it up in the next release of ColdFusion. For the other two bugs, #CF-3928680 and #CF-3931673, we have already raised an ER with the acrobat team. We will keep you updated about its progress. For the other changes you have asked, we will evaluate and get back to you. But since they require language changes, they will be taken up in the next release and not in updates.
Comment by Kailash B.
3018 | May 05, 2016 03:10:22 AM GMT
We will be taking up cfhtmltopdfsection in the next release of ColdFusion
Comment by Kailash B.
3019 | August 09, 2016 05:21:50 AM GMT
Hi Kailash, Regarding "We will be taking up cfhtmltopdfsection in the next release of ColdFusion": Thanks very much, for taking that up for Aether! -Aaron
Comment by Aaron N.
3020 | August 03, 2017 05:36:30 PM GMT
Voting on the bookmark issue. This has been reported several times since CF9 and STILL has not been addressed.
Vote by Mary J.
3021 | August 24, 2017 07:32:48 PM GMT