使用ApacheFop 2.2我得到一个多页文档。该文档由部分组成,每个部分以第1页开头。 在形成PDF之后,需要打印文档的第5页。指定打印页面时,将打印文档的第11页(本部分为第5页)。 如何正确生成PDF,以便第5页正好是文档的第5页,而不是文档的一部分?
FO:
<?xml version="1.0"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xlink="http://www.w3.org/1999/xlink" font-size="30pt">
<fo:layout-master-set>
<fo:simple-page-master master-name="page">
<fo:region-body region-name="body" margin-top="22mm" margin-bottom="34mm"/>
<fo:region-after region-name="footer" extent="31mm"/>
</fo:simple-page-master>
<fo:simple-page-master master-name="blank-page">
<fo:region-body region-name="body-blank" margin-top="22mm" margin-bottom="34mm"/>
<fo:region-after region-name="footer" extent="31mm"/>
</fo:simple-page-master>
<fo:page-sequence-master master-name="document">
<fo:repeatable-page-master-alternatives>
<fo:conditional-page-master-reference blank-or-not-blank="not-blank" master-reference="page"/>
<fo:conditional-page-master-reference blank-or-not-blank="blank" odd-or-even="even" master-reference="blank-page"/>
</fo:repeatable-page-master-alternatives>
</fo:page-sequence-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="document" initial-page-number="1" force-page-count="end-on-even">
<fo:static-content flow-name="footer">
<fo:block>
<fo:page-number/>
</fo:block>
</fo:static-content>
<fo:flow flow-name="body">
<fo:block break-after="page">Text1</fo:block>
</fo:flow>
</fo:page-sequence>
<fo:page-sequence master-reference="document" initial-page-number="1" force-page-count="end-on-even">
<fo:static-content flow-name="footer">
<fo:block>
<fo:page-number/>
</fo:block>
</fo:static-content>
<fo:flow flow-name="body">
<fo:block break-after="page">Text3</fo:block>
<fo:block break-after="page">Text4</fo:block>
<fo:block break-after="page">Text5</fo:block>
</fo:flow>
</fo:page-sequence>
<fo:page-sequence master-reference="document" initial-page-number="1" force-page-count="end-on-even">
<fo:static-content flow-name="footer">
<fo:block>
<fo:page-number/>
</fo:block>
</fo:static-content>
<fo:flow flow-name="body">
<fo:block break-after="page">Text7</fo:block>
<fo:block break-after="page">Text8</fo:block>
<fo:block break-after="page">Text9</fo:block>
<fo:block break-after="page">Text10</fo:block>
<fo:block break-after="page">Text11</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
答案 0 :(得分:1)
在这种情况下,页码不是告诉用户打印哪个页面的最佳方式,因为它无论如何都会让人感到困惑。例如,您的文档中可能有多个页面编号为5的页面。 替代方案: