问题描述
如何在 XSL 中识别具有单页或多页的 PDF?
我有一个显示当前页码和总页码的页脚,如果 PDF 页面只有一个页面,我要求在页脚中不显示文本(lastPage 的第 1 页)。
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:java="http://xml.apache.org/xslt/java" xmlns:str="http://exslt.org/strings"
exclude-result-prefixes="fo">
<xsl:template match="/">
<fo:root>
<fo:layout-master-set>
<fo:simple-page-master master-name="simpleA4" page-height="29.7cm" page-width="21cm" margin-top="0.5cm" margin-left="0.7cm" margin-right="0.7cm" padding-right="0.3cm">
<fo:region-body region-name="xsl-region-body" margin-top="3.8cm" margin-bottom="1.5cm" />
<fo:region-before region-name="xsl-region-before" margin-top="2.2cm" extent="5in" />
<fo:region-after region-name="xsl-region-after" extent=".8in" />
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="simpleA4">
<fo:static-content flow-name="xsl-region-before">
<fo:block>
</fo:block>
</fo:static-content>
<fo:static-content flow-name="xsl-region-after">
<fo:block>
<fo:leader leader-length="100%" leader-pattern="rule" rule-style="solid" rule-thickness="0.9px" />
</fo:block>
<fo:block font-size="10pt" font-weight="normal" text-align="center">
Page
<fo:page-number />
of
<fo:page-number-citation ref-id="lastPage" />
</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
<fo:block>
body
</fo:block>
<fo:block id="lastPage" />
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
</xsl:stylesheet>
是否有任何内置函数或标记可以为我提供 xsl-region-after
中的最后一个页码?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)