5

I'm creating a multipage document using cfdocument (created using dynamic text so could have any number of pages even one).

I can use <cfdocumentitem type="footer"> to add a footer to every page, but is there any way I can only add a footer to just the last page of the document?

Thanks.

Loftx
  • 1,760
  • 4
  • 29
  • 50

1 Answers1

12

Just add the evalAtPrint attribute. Then you can use the page number variables to conditionally set the footer.

<cfdocumentitem type="footer" evalAtPrint="true">
    <cfif cfdocument.currentPageNumber eq cfdocument.totalPageCount>
        This is the last page
    </cfif>
</cfdocumentitem>
Leigh
  • 28,765
  • 10
  • 55
  • 103
  • Although it's not listed in the [documentation for cfdocumentitem in CF8](http://livedocs.adobe.com/coldfusion/8/htmldocs/Tags_d-e_06.html#3980064), it does work. – Jon Dowdle May 23 '11 at 20:55
  • @Jon - Yes, you are right. The CF9 documentation says it was added in CF8, but I feel like it was 8.0.1. http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7758.html – Leigh May 23 '11 at 21:07