【问题标题】:displaying footer on last page在最后一页显示页脚
【发布时间】:2021-01-18 00:21:01
【问题描述】:

我有一个可以有多个页面的动态 pdf。目前我希望页脚只显示在最后一页而不是所有页面。

此代码显示在所有页面中。

<fo:layout-master-set>
  <fo:simple-page-master conditional-page-master-reference="first" page-height="29.7cm" page-width="21cm">
    <fo:region-body margin-bottom="10mm" margin-left="10mm" margin-right="10mm" margin-top="10mm"/>
    <fo:region-after extent="10mm" margin-left="1cm"/>
  </fo:simple-page-master>
</fo:layout-master-set>

<fo:page-sequence conditional-page-master-reference="first">
  <fo:static-content flow-name="xsl-region-after">
    <fo:block>I need my footer disclaimer here</fo:block>
  </fo:static-content>

【问题讨论】:

    标签: pdf xsl-fo apache-fop


    【解决方案1】:

    您希望它指向一个fo:page-sequence-master(请参阅https://www.w3.org/TR/xsl11/#fo_page-sequence-master),而不是fo:page-sequence 引用单个fo:simple-page-master,该https://www.w3.org/TR/xsl11/#fo_page-sequence-master 具有用于根据页面将在哪里选择特定fo:simple-page-master 的子元素在它的页面序列中。

    在您的情况下,您希望为具有 fo:region-after 和不同 region-name 的最后一页选择 fo:simple-page-master。您在fo:page-sequence 中的fo:static-content 应使用相同的区域名称,以便免责声明仅针对该fo:region-after

    `page-position="last"' 的例子(见https://www.w3.org/TR/xsl11/#page-position)包括:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-10-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-07-27
      • 2013-03-30
      • 2013-11-18
      相关资源
      最近更新 更多