Hi all,
I am at a loss how to access a variable that's set inside of a cfdocumentitem tag. The reason I'm doing this is that a client of mine is wanting to print invoices in their browser but they are using double sided paper so I need to access the current page number and if it's not an odd numbered page, I need to force another page break.
So my code looks somerthing like this:
<cfdocumentformat="pdf">
<cfloop query="getOrders">
Invoice stuff here...
<cfdocumentitemtype="pagebreak"></cfdocumentitem><!--- Add one page break by default after every order --->
<cfdocumentitemtype="footer"evalatprint="true">
<cfif CFDocument.CurrentPageNumber MOD2EQ0>
<cfset AddPageBreak = 0><!--- This is the back side of a page so we don't need to add another page break --->
<cfelse>
<cfset AddPageBreak = 1><!--- This is the front side of the page so we do need to add another page break --->
</cfif>
</cfdocumentitem>
<cfif AddPageBreak>
<cfdocumentitemtype="pagebreak"></cfdocumentitem><!--- Add an additional page break for orders that do not end on an even page --->
</cfif>
</cfloop>
</cfdocument>
Of course this doesn't work because I've learned that cfdocument is implemented as a custom tag. The error I'm getting is "Variable ADDPAGEBREAK is undefined".
Does anyone have any ideas how to accomplish this?