这是我的代码:
<fo:static-content flow-name="xsl-region-after">
<fo:block text-align="right" font-size="20pt" margin-right="0.5cm">
<fo:page-number/></fo:block>
</fo:static-content>
只有一张幻灯片序列,但是我想从第一张开始编号,但是从第二张幻灯片或第三张幻灯片开始编号。有人能帮助我吗?
最佳答案
为没有fo:simple-page-master
的首页制作一个单独的fo:region-after
,并使用fo:page-sequence-master
为首页指定特殊的fo:simple-page-master
,然后对其余幻灯片使用常规的fo:simple-page-master
。例如。:
<fo:layout-master-set>
<fo:simple-page-master master-name="first">
<fo:region-body margin="36pt" />
</fo:simple-page-master>
<fo:simple-page-master master-name="rest">
<fo:region-body margin="36pt" />
<fo:region-after extent="36pt" />
</fo:simple-page-master>
<fo:page-sequence-master master-name="psm">
<fo:single-page-master-reference master-reference="first" />
<fo:repeatable-page-master-reference master-reference="rest" />
</fo:page-sequence-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="psm">
<fo:static-content flow-name="xsl-region-after">
<fo:block text-align="right" font-size="20pt" margin-right="0.5cm">
<fo:page-number/>
</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
<xsl:apply-templates />
</fo:flow>
</fo:page-sequence>
对于未编号的第一张幻灯片和第二张编号为“ 1”的幻灯片,请将第一张幻灯片放在单独的
fo:page-sequence
中:<fo:layout-master-set>
<fo:simple-page-master master-name="first">
<fo:region-body margin="36pt" />
</fo:simple-page-master>
<fo:simple-page-master master-name="rest">
<fo:region-body margin="36pt" />
<fo:region-after extent="36pt" />
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="first" force-page-count="no-force">
<fo:flow flow-name="xsl-region-body">
<fo:block>Title slide</fo:block>
</fo:flow>
</fo:page-sequence>
<fo:page-sequence master-reference="rest" initial-page-number="1">
<fo:static-content flow-name="xsl-region-after">
<fo:block text-align="right" font-size="20pt" margin-right="0.5cm">
<fo:page-number/>
</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
<fo:block>Slide 1</fo:block>
</fo:flow>
</fo:page-sequence>
如果页码的存在是唯一的不同,则可以简化为:
<fo:layout-master-set>
<fo:simple-page-master master-name="spm">
<fo:region-body margin="36pt" />
<fo:region-after extent="36pt" />
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="spm" force-page-count="no-force">
<fo:flow flow-name="xsl-region-body">
<fo:block>Title slide</fo:block>
</fo:flow>
</fo:page-sequence>
<fo:page-sequence master-reference="spm" initial-page-number="1">
<fo:static-content flow-name="xsl-region-after">
<fo:block text-align="right" font-size="20pt" margin-right="0.5cm">
<fo:page-number/>
</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
<fo:block>Slide 1</fo:block>
</fo:flow>
</fo:page-sequence>
关于xml - 如何从第2或3页开始页码编号?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/43799286/