Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding a footer only to the last page when using cfdocument

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.

like image 669
Loftx Avatar asked Jan 25 '11 15:01

Loftx


1 Answers

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>
like image 54
Leigh Avatar answered Nov 20 '22 02:11

Leigh