我正在尝试生成 pdf,但我不知道如何在每个页面中添加页眉和页脚。我正在使用 xsl-fo 命名空间,这里是 xsl 代码的根目录。
<xsl:template match="ROOT">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="simpleA4"
page-height="450mm" page-width="350mm" margin-top="20mm"
margin-bottom="20mm" margin-left="20mm" margin-right="20mm">
<fo:region-body border="solid thick black" />
</fo:simple-page-master>
<fo:page-sequence-master master-name="SequenceMaster1">
<fo:repeatable-page-master-reference
maximum-repeats="3" master-reference="simpleA4" />
</fo:page-sequence-master>
</fo:layout-master-set>
<xsl:apply-templates />
</fo:root>
</xsl:template>
和我的页面模板:
<xsl:template match="PAGE">
<fo:page-sequence master-reference="SequenceMaster1"
text-align="center">
<fo:flow flow-name="xsl-region-body">
<fo:block font-family="Arial" text-align="left"
language="tr">
<!-- ======================================Common Bigger table========================================================================================= -->
<fo:table width="100%" border-before-width="thin"
border-top-width="thick">
<fo:table-column column-width="310mm" />
<fo:table-body break-after="page" border-width="1mm" border-style="solid" height="410mm">
<fo:table-row>
<fo:table-cell padding-left="2mm" height="410mm">
<xsl:apply-templates />
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:block>
</fo:flow>
</fo:page-sequence>
</xsl:template>