Xslt 我正在尝试用fop打印多页
我正在尝试使用此代码添加多个页面。每个页面的内容都是独立的。我寻找了一个关于如何添加多个页面的示例,但我来的每个人都没有为我工作过。我是不是犯了一些一般性的错误?如果有人能将我需要使用的基本结构添加到页面中,那将非常有帮助Xslt 我正在尝试用fop打印多页,xslt,xsl-fo,apache-fop,Xslt,Xsl Fo,Apache Fop,我正在尝试使用此代码添加多个页面。每个页面的内容都是独立的。我寻找了一个关于如何添加多个页面的示例,但我来的每个人都没有为我工作过。我是不是犯了一些一般性的错误?如果有人能将我需要使用的基本结构添加到页面中,那将非常有帮助 <?xml version="1.0" encoding="UTF-8" ?> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xs="http://www.w3.or
<?xml version="1.0" encoding="UTF-8" ?>
<fo:root
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:fox="http://xmlgraphics.apache.org/fop/extensions"
font-family="Freesans">
<fo:layout-master-set>
<fo:simple-page-master master-name="standard"
page-height="15.2cm"
page-width="8.1cm"
margin-top="1cm"
margin-bottom="1cm"
margin-left="1.5cm"
margin-right="1.5cm">
<fo:region-body margin-top="1cm"/>
</fo:simple-page-master>
<fo:simple-page-master master-name="rest"
page-height="15.2cm"
page-width="8.1cm"
margin-top="1cm"
margin-bottom="1cm"
margin-left="1.5cm"
margin-right="1.5cm">
<fo:region-body margin-top="1cm"/>
</fo:simple-page-master>
<fo:page-sequence-master master-name="standard">
<fo:repeatable-page-master-reference master-name="rest"/>
</fo:page-sequence-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="standard" force-page-count="no-force">
<fo:flow flow-name="xsl-region-body" font-size="8pt">
<fo:block text-align="right" >
<fo:page-number/> / <fo:page-number-citation ref-id="totalPages"/>
</fo:block>
<!--content-->
<fo:block id="totalPages"></fo:block>
</fo:flow>
</fo:page-sequence>
<fo:page-sequence master-reference="rest" force-page-count="no-force">
<fo:flow flow-name="xsl-region-body" font-size="8pt">
<fo:block text-align="right" >
<fo:page-number/> / <fo:page-number-citation ref-id="totalPages"/>
</fo:block>
<!--content-->
<fo:block id="totalPages"></fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
/
/
对不起,我不明白这个问题。当你说多个页面可以单独工作时,你所说的“多个页面”是什么意思?您可以尝试查看上的示例,看看它们是否对您有所帮助。到目前为止,我在显示的代码中没有看到任何明显的错误,但页面序列不包含任何引用您的内容的代码。按原样,您的代码将生成两个空页面。