RTF 格式的 XSL-FO break-after="page"
XSL-FO break-after="page" in RTF
我试图在每个 table 之后分页。 table 中的每一个都在 <fo:block break-after="page" keep-together.within-page="0">
中。
它似乎在转换为 PDF 时有效,但不适用于 RTF。
RTF 转换器是否存在某种错误,或者我做错了什么?
我 运行 使用 apache FOP 2.2。
完整文档:
<?xml version="1.0" encoding="UTF-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="A4" page-width="210mm" page-height="297mm" margin-top="7mm" margin-bottom="7mm" margin-left="2cm" margin-right="2cm">
<!-- Page template goes here -->
<fo:region-body margin-top="8mm" margin-bottom="8mm"/>
<fo:region-before extent="5mm"/>
<fo:region-after extent="5mm"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="A4">
<fo:static-content flow-name="xsl-region-before" font-size="8pt">
<fo:block text-align-last="justify" border-bottom-style="solid" border-bottom-width="0.2pt"><!-- --><fo:page-number/>/<fo:page-number-citation ref-id="last-page"/><!-- --><fo:leader leader-pattern="space"/>TEST</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body" font-size="8pt">
<!-- -->
<!--
-->
<fo:block break-after="page" keep-together.within-page="0">
<fo:table table-layout="fixed" width="100%">
<!-- -->
<fo:table-column column-width="17cm"/>
<!-- -->
<fo:table-body>
<fo:table-row>
<!-- -->
<fo:table-cell>
<fo:block linefeed-treatment="preserve" white-space-collapse="false"><fo:inline font-weight="bold"/>
<fo:inline font-weight="bold">
<fo:inline font-style="italic">test
</fo:inline>
</fo:inline>
test
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
<fo:block>
<fo:leader leader-length="100%" leader-pattern="rule" rule-style="solid" rule-thickness="0.2pt" color="black"/>
</fo:block>
</fo:block>
<!-- -->
<fo:block break-after="page" keep-together.within-page="0">
<fo:table table-layout="fixed" width="100%">
<!-- -->
<fo:table-column column-width="17cm"/>
<!-- -->
<fo:table-body>
<fo:table-row>
<!-- -->
<fo:table-cell>
<fo:block linefeed-treatment="preserve" white-space-collapse="false">
<fo:inline font-weight="bold">test
</fo:inline>test
<fo:inline font-weight="bold">
<fo:inline font-style="italic">La Sieste
</fo:inline>
</fo:inline>
test
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
<fo:block>
<fo:leader leader-length="100%" leader-pattern="rule" rule-style="solid" rule-thickness="0.2pt" color="black"/>
</fo:block>
</fo:block>
<!-- -->
<fo:block id="last-page"/>
</fo:flow>
</fo:page-sequence>
</fo:root>
FOP 的 RTF 后端未实现 break-before
和 break-after
。参见 https://xmlgraphics.apache.org/fop/2.2/output.html#rtf
我试图在每个 table 之后分页。 table 中的每一个都在 <fo:block break-after="page" keep-together.within-page="0">
中。
它似乎在转换为 PDF 时有效,但不适用于 RTF。
RTF 转换器是否存在某种错误,或者我做错了什么? 我 运行 使用 apache FOP 2.2。
完整文档:
<?xml version="1.0" encoding="UTF-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="A4" page-width="210mm" page-height="297mm" margin-top="7mm" margin-bottom="7mm" margin-left="2cm" margin-right="2cm">
<!-- Page template goes here -->
<fo:region-body margin-top="8mm" margin-bottom="8mm"/>
<fo:region-before extent="5mm"/>
<fo:region-after extent="5mm"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="A4">
<fo:static-content flow-name="xsl-region-before" font-size="8pt">
<fo:block text-align-last="justify" border-bottom-style="solid" border-bottom-width="0.2pt"><!-- --><fo:page-number/>/<fo:page-number-citation ref-id="last-page"/><!-- --><fo:leader leader-pattern="space"/>TEST</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body" font-size="8pt">
<!-- -->
<!--
-->
<fo:block break-after="page" keep-together.within-page="0">
<fo:table table-layout="fixed" width="100%">
<!-- -->
<fo:table-column column-width="17cm"/>
<!-- -->
<fo:table-body>
<fo:table-row>
<!-- -->
<fo:table-cell>
<fo:block linefeed-treatment="preserve" white-space-collapse="false"><fo:inline font-weight="bold"/>
<fo:inline font-weight="bold">
<fo:inline font-style="italic">test
</fo:inline>
</fo:inline>
test
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
<fo:block>
<fo:leader leader-length="100%" leader-pattern="rule" rule-style="solid" rule-thickness="0.2pt" color="black"/>
</fo:block>
</fo:block>
<!-- -->
<fo:block break-after="page" keep-together.within-page="0">
<fo:table table-layout="fixed" width="100%">
<!-- -->
<fo:table-column column-width="17cm"/>
<!-- -->
<fo:table-body>
<fo:table-row>
<!-- -->
<fo:table-cell>
<fo:block linefeed-treatment="preserve" white-space-collapse="false">
<fo:inline font-weight="bold">test
</fo:inline>test
<fo:inline font-weight="bold">
<fo:inline font-style="italic">La Sieste
</fo:inline>
</fo:inline>
test
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
<fo:block>
<fo:leader leader-length="100%" leader-pattern="rule" rule-style="solid" rule-thickness="0.2pt" color="black"/>
</fo:block>
</fo:block>
<!-- -->
<fo:block id="last-page"/>
</fo:flow>
</fo:page-sequence>
</fo:root>
break-before
和 break-after
。参见 https://xmlgraphics.apache.org/fop/2.2/output.html#rtf