Copy link to clipboard
Copied
I am looking to see if there is a solution out there using Coldfusion 11:
If a pdf document is created with cfdocument tag, is there a way to tell if/when a page break occurs while the pdf is being created? ... Keeping in mind the content of the document varies...?? I am not aware of a way to accomplish this so any info would be greatly appreciated...
Thanks
Copy link to clipboard
Copied
You could do something like this. Place the cfdocumentitem tag at the top.
<cfset pagecount = 0>
<cfdocument format="PDF">
<cfdocumentitem type= "header">
<cfif cfdocument.currentpagenumber GT pagecount>
Start of new page: <cfoutput>#cfdocument.currentpagenumber#</cfoutput>
<cfset pagecount = pagecount+1>
</cfif>
</cfdocumentitem>
</cfdocument>