CFDocument没有在lucee中显示动态页码

时间:2017-04-06 11:08:23

标签: cfml lucee cfdocument

使用Lucee,如何使用cfdocument范围变量将动态页码添加到pdf文件中?

  • cfdocument.totalsectionpagecount
  • cfdocument.currentsectionpagenumber
  • cfdocument.currentpagenumber
  • cfdocument.totalpagecount

我尝试了下面的代码。它生成pdf,但页眉和页脚是空的,而不是显示页码,即。 “X of Y”。

<cfdocument format="pdf">
    <cfdocumentitem type="header" evalatprint="true">
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
            <strong><tr><td align="right"><cfoutput>#cfdocument.currentsectionpagenumber# of</strong>
                <strong>#cfdocument.totalsectionpagecount#</cfoutput></td></tr></strong>
        </table>
    </cfdocumentitem>
    <cfdocumentitem type="footer" evalatprint="true">
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
            <strong><tr><td align="center"><cfoutput>#cfdocument.currentpagenumber# of</strong>
                <strong>#cfdocument.totalpagecount#</cfoutput></td></tr></strong>
        </table>
    </cfdocumentitem>
    <cfdocumentsection>
        <h1>Section 1</h1>
        <cfloop from=1 to=50 index="i">
            Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna     aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis     aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint     occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.<p>
        </cfloop>
    </cfdocumentsection>
</cfdocument>

0 个答案:

没有答案