【问题标题】:Adding a footer only to the last page when using cfdocument使用 cfdocument 时仅在最后一页添加页脚
【发布时间】:2011-06-15 06:39:24
【问题描述】:

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

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

谢谢。

【问题讨论】:

    标签: coldfusion footer cfdocument


    【解决方案1】:

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

    <cfdocumentitem type="footer" evalAtPrint="true">
        <cfif cfdocument.currentPageNumber eq cfdocument.totalPageCount>
            This is the last page
        </cfif>
    </cfdocumentitem>
    

    【讨论】:

    【解决方案2】:

    如您所知,即使 evalAtPrint 设置为 true,您也无法评估 cfdocument.currentpagenumber 来为特定页面显示不同的页脚。这是我的解决方案。

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

    【讨论】:

    • 虽然此链接可能会回答问题,但最好在此处包含答案的基本部分并提供链接以供参考。如果链接页面发生更改,仅链接的答案可能会失效
    • @Patrick - 你用的是什么版本?使用 CF9/10 对我来说效果很好(我相信 8.0.1 也是如此)。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-10-03
    • 1970-01-01
    • 2016-07-24
    • 1970-01-01
    相关资源
    最近更新 更多