使用 cfdocument 时仅在最后一页添加页脚 [英] Adding a footer only to the last page when using cfdocument

查看:17
本文介绍了使用 cfdocument 时仅在最后一页添加页脚的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 cfdocument 创建一个多页文档(使用动态文本创建,因此可以有任意数量的页面,甚至一个页面).

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

我可以使用 <cfdocumentitem type="footer"> 为每一页添加页脚,但是有什么方法我只能在文档的最后一页添加页脚?

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?

谢谢.

推荐答案

只需添加 evalAtPrint 属性即可.然后可以使用页码变量有条件地设置页脚.

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>

这篇关于使用 cfdocument 时仅在最后一页添加页脚的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆