Adding a footer only to the last page when using cfdocument

匿名 (未验证) 提交于 2019-12-03 08:46:08

问题:

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.

回答1:

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>


回答2:

As you know you cannot evaluate cfdocument.currentpagenumber to display a different footer for a particular page even with evalAtPrint set to true. Here was my solution.

http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7758.html



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!