我正在使用 XSLT-FO 生成一封信 (pdf)。在第一页上,我有公司徽标/图像和信件内容的开头。我不想在任何其他页面上显示徽标,所以我使用可重复页面主替代方案。问题是它在下一页重复文本块 (smf:body),而不是从第一页继续。我做了很多互联网搜索,试图找出原因 - 但我无法解决。这是一个 XSL-FO:
<xsl:template match="/smf:workItem">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="first-page" page-height="29.7cm" page-width="21cm" margin-top="0.5cm" margin-bottom="1cm" margin-left="1.75cm">
<fo:region-body margin-right="2cm" margin-top="1.27cm" margin-bottom="1mm" />
<fo:region-before region-name="header-first" extent="0mm" />
<fo:region-after region-name="footer-first" extent="0mm" />
<fo:region-end border-top-width="5pt" region-name="right-sidebar" writing-mode="tb-rl" extent="10mm" />
</fo:simple-page-master>
<fo:simple-page-master master-name="all-pages" page-height="29.7cm" page-width="21cm" margin-top="0.5cm" margin-bottom="1cm" margin-left="1.75cm">
<fo:region-body margin-left="0.25cm" margin-right="2cm" margin-top="1.27cm" margin-bottom="1mm" />
<fo:region-before region-name="header-normal" extent="0mm" />
<fo:region-after region-name="footer-normal" extent="0mm" />
</fo:simple-page-master>
<fo:page-sequence-master master-name="document" font-family="Helvetica">
<fo:repeatable-page-master-alternatives>
<fo:conditional-page-master-reference page-position="first" master-reference="first-page"/>
<fo:conditional-page-master-reference page-position="any" master-reference="all-pages" />
</fo:repeatable-page-master-alternatives>
</fo:page-sequence-master>
<!--
<fo:page-sequence-master master-name="document" font-family="Helvetica">
<fo:single-page-master-reference master-reference="first-page"/>
<fo:repeatable-page-master-reference master-reference="all-pages"/>
</fo:page-sequence-master>
-->
</fo:layout-master-set>
<fo:page-sequence master-reference="document">
<fo:static-content flow-name="header-first" font-size="10pt">
<fo:external-graphic src="url('C:\Program Files (x86)\numerointeractive\whitemail\Images\club1830.jpg')" />
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
<fo:block font-size="10pt" linefeed-treatment="preserve" white-space-collapse="false" white-space-treatment="ignore-if-surrounding-linefeed" wrap-option="wrap">
<xsl:value-of select="smf:body"/>
</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
请有人可以帮我解决这个问题。块 (smf:body) 位于定义我的布局的页面序列中,但由于某种原因它重复了它。任何帮助将不胜感激。
谢谢。
ps - 我也尝试过使用单个/可重复的页面母版,但它的行为相同