XSL-FO:多个页码序列
XSL-FO: Multiple Pagenumber Sequences
有一个包含两个部分的文档,因此需要两个页码序列,一个用于文档,一个用于每个部分。
所以每页都会打印 2 个页码
第 1 部分:部分页码,文档页码
第 2 节:第页 #、文档页 #
如何实现?
如果你想要的是这样的:
- 第 1 节第 1 页,文档第 1 页
- 第 1 节第 2 页,文档第 2 页
- 第 2 部分第 1 页,文档第 3 页
- ...
仅使用标准 FO 元素和属性无法实现。
每个fo:page-sequence
可以定义一个新的initial-page-number
或继续之前的页码序列;在这两种情况下,每个页面只有一个页码:
The value of the folio-number trait on the first page returned by the fo:page-sequence is constrained to equal the value of the initial-page-number trait. The value of the folio-number trait on subsequent pages is constrained to be one greater than the value on the immediately preceding page.
The format, letter-value, grouping-separator, grouping-size, country, and language traits are used to format the number into a string form, as specified in XSLT. This formatted number is used by the fo:page-number flow object.
@lfurini 关于 XSL 1.1 属性是正确的。但是,如果您使用的是 AH Formatter,则可以在第二个 fo:page-number
上使用 axf:physical-page-number
(https://www.antennahouse.com/product/ahf64/ahf-ext.html#axf.physical-page-number) 来获取物理页码。
有一个包含两个部分的文档,因此需要两个页码序列,一个用于文档,一个用于每个部分。
所以每页都会打印 2 个页码
第 1 部分:部分页码,文档页码
第 2 节:第页 #、文档页 #
如何实现?
如果你想要的是这样的:
- 第 1 节第 1 页,文档第 1 页
- 第 1 节第 2 页,文档第 2 页
- 第 2 部分第 1 页,文档第 3 页
- ...
仅使用标准 FO 元素和属性无法实现。
每个fo:page-sequence
可以定义一个新的initial-page-number
或继续之前的页码序列;在这两种情况下,每个页面只有一个页码:
The value of the folio-number trait on the first page returned by the fo:page-sequence is constrained to equal the value of the initial-page-number trait. The value of the folio-number trait on subsequent pages is constrained to be one greater than the value on the immediately preceding page.
The format, letter-value, grouping-separator, grouping-size, country, and language traits are used to format the number into a string form, as specified in XSLT. This formatted number is used by the fo:page-number flow object.
@lfurini 关于 XSL 1.1 属性是正确的。但是,如果您使用的是 AH Formatter,则可以在第二个 fo:page-number
上使用 axf:physical-page-number
(https://www.antennahouse.com/product/ahf64/ahf-ext.html#axf.physical-page-number) 来获取物理页码。