tracker issue : CF-3931678

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

[ANeff] ER for: <cfhtmltopdfitem evalatprint="true|false">

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Aaron Neff / Aaron Neff (Aaron Neff)

Created: 01/31/2015

Components: Document Management

Versions: 11.0

Failure Type: Enhancement Request

Found In Build/Fixed In Build: CF11_Final /

Priority/Frequency: Normal / Unknown

Locale/System: English / Win All

Vote Count: 1

Listed in the version 2016.0.03.300466 Issues Fixed doc
Currently <cfhtmltopdfitem> cannot use its page variables in expressions like <cfdocumentitem> can.  For example, this <cfdocumentitem> code works:

<cfdocumentitem type="header" evalatprint="true">
<cfif CFDOCUMENT.CurrentPageNumber mod 2 is 0>something<cfelse>something else</cfif>
</cfdocumentitem>

However, this <cfhtmltopdfitem> code throws exception "An error has occurred while retrieving content for setting Header/Footer.":

<cfhtmltopdfitem type="header" evalatprint="true">
<cfif _CURRENTPAGENUMBER mod 2 is 0>something<cfelse>something else</cfif>
</cfhtmltopdfitem>

Removing the evalatprint="true" attribute throws the same exception.

This is just one of the reasons most existing <cfdocumentitem type="header|footer"> tags cannot be converted to <cfhtmltopdfitem type="header|footer">, and why <cfhtmltopdfitem type="header|footer"> cannot even be used for new code.

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3931678

External Customer Info:
External Company:  
External Customer Name: Aaron
External Customer Email:

Attachments:

Comments:

+1 ...............................
Vote by External U.
8639 | January 31, 2015 04:08:34 PM GMT
<cfhtmltopdfitem> uses Acrobat engine to generate PDF from HTML. Acrobat engine does not allow to use document related variables. So this is a limitation from Acrobat. Thus deferring it. (Comment added from ex-user id:bukkittu)
Comment by Adobe D.
8625 | February 03, 2015 12:37:46 AM GMT
Hi Avinash, Thanks for letting us know that. Can a ticket please be created with the Acrobat team to add this ability? Because this is an important feature. Thanks!, -Aaron
Comment by External U.
8626 | February 03, 2015 05:50:00 AM GMT
Repeating: "Can a ticket please be created with the Acrobat team to add this ability?" Please ensure the ticket is public for voting. This is a critical limitation and prevents our migration from <cfdocument> to <cfhtmltopdf>. Thanks!, -Aaron
Comment by External U.
8627 | May 20, 2015 12:18:47 PM GMT
*bump* Can a publicly-viewable ticket please be created w/ the Acrobat team? Then can you please share that ticket #? Thanks!, -Aaron
Comment by External U.
8628 | August 21, 2015 10:36:16 PM GMT
Asking again, can a ticket please be created w/ Acrobat team? This is a limitation when switching from cfdocument to cfhtmltopdf. Thanks!, -Aaron
Comment by External U.
8629 | December 02, 2015 03:51:24 AM GMT
Acrobat engine runs in a separate process and it can only render the content that is given to it. It cannot process any conditional expressions/script. Nor can we get a callback for each page while acrobat is building the pdf. Hence evalAtPrint can not be supported.
Comment by Rupesh K.
8630 | December 02, 2015 04:41:31 AM GMT
Hi Rupesh, Thanks very much for that explanation. So could a ticket please be created w/ the Acrobat team (either for conditional expressions or a callback), so that code can be upgraded from cfdocument to cfhtmltopdf? Thanks!, -Aaron
Comment by External U.
8631 | December 02, 2015 06:26:17 AM GMT
My original question was: "can a ticket please be created w/ Acrobat team?" I do appreciate the explanation about how the Acrobat engine runs, but Adobe can you please stop ignoring my question? I'm sure the smart engineers on the CF Team and Acrobat Team can find a creative solution. What I'm most interested in is using the page number variables in conditional expressions. If cfhtmltopdf is marketed as an upgrade to cfdocument, then the CF Team should create a ticket w/ the Acrobat Team to come up w/ a fix. Thanks!, -Aaron
Comment by External U.
8632 | December 05, 2015 07:15:25 AM GMT
*bump* (a month later) Can a ticket *please* be opened w/ the Acrobat team, and ticket number posted here? The CF Team should not be satisfied w/ these cfhtmltopdf limitations and should be working w/ other Adobe teams to lift the limitations so that customers can upgrade to cfhtmltopdf. It really boggles my mind how Adobe, the creator of PDF, cannot seem to sort out how to accomplish something in cfhtmltopdf that was doable in cfdocument. At the very least, all I'm asking is that a ticket please be opened w/ the Acrobat team. It would seem that'd be the 1st step towards resolution? Thanks!, -Aaron
Comment by External U.
8633 | January 05, 2016 02:06:19 AM GMT
This requires language changes, and so will be taken up as a part of next release of ColdFusion
Comment by Kailash B.
8634 | May 05, 2016 03:05:18 AM GMT
A new attribute evalAtPrint has been added to cfhtmltopdfitem tag to replicate the behaviour of cfdocumentitem. There is a limitation that if evalAtPrint is true then numberformat has to be NUMERIC.
Comment by Chinoy G.
8635 | August 03, 2016 11:52:36 PM GMT
Hi Adobe, I've verified this is fixed in CF2016 Update 3 (build 2016.0.03.300466). Hi Chinoy, What do you mean by "numberformat has to be NUMERIC"? Number format of what? And when would that number -not- be numeric?? It doesn't make sense to me, sry. Hopefully we can get clarification? Thanks very much!!!!, -Aaron
Comment by External U.
8636 | November 01, 2016 02:40:03 PM GMT
Hi Aaron, cfhtmltopdfitem tag has an attribute called numberformat. Its default is numeric but it can be set to ROMAN also. Now if it is set as ROMAN and evalAtPrint is true and user has some conditional code based on pagenumbers, then that code will not work properly.
Comment by Chinoy G.
8637 | November 01, 2016 10:13:47 PM GMT
Hi Chinoy, AH! Thanks very much for that clarification! That makes sense. I've filed CF-4197214 to document that clarification. I've also filed CF-4197215 for numberFormat(number, "roman"). Thanks!, -Aaron
Comment by External U.
8638 | November 02, 2016 12:51:57 AM GMT