XSL-FO break-after =" page"在RTF中

时间:2017-06-02 12:15:02

标签: xsl-fo apache-fop

我试图在每张桌子后分页。每个表都在<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>

1 个答案:

答案 0 :(得分:1)

FOP的RTF后端未实现

break-beforebreak-after。见https://xmlgraphics.apache.org/fop/2.2/output.html#rtf