我过去所做的是<fo:page-number-citation>用于 TOC(目录)中的每个条目。我将目录作为<fo:table>.
该<fo:page-number-citation>有一个ref-id应该包含属性id你引用的位置。它应该生成 PDF 页码所在id的位置。
例如,如果你想每一个<chapter>在你的TOC引用,你可以使用<fo:page-number-citation>一个ref-id匹配的id的地方的<chapter>是输出(如fo:page-sequence,fo:block等)。
这是一个例子。我将id属性基于现有属性的值,但如果需要,您可以生成一个 id。
示例章节 XML:
<chapter foo="CHAP-1">
...
</chapter>
Run Code Online (Sandbox Code Playgroud)
TOC 表中的示例条目:
<fo:table-cell>
<fo:block>
<fo:page-number-citation ref-id="CHAP-1"/>
</fo:block>
</fo:table-cell>
Run Code Online (Sandbox Code Playgroud)
输出示例<chapter>:
<fo:page-sequence id="CHAP-1">
...
</fo:page-sequence>
Run Code Online (Sandbox Code Playgroud)
您还可以fo:page-number-citation用 anfo:basic-link将目录中的页码链接到实际页面。
| 归档时间: |
|
| 查看次数: |
4037 次 |
| 最近记录: |