1 Reply Latest reply on Aug 11, 2016 10:03 PM by BKBK

    When does a page break occur - cfdocument?

    montefuscom

      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

        • 1. Re: When does a page break occur - cfdocument?
          BKBK Adobe Community Professional & MVP

          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>

          1 person found this helpful