2012-07-31 10 views
6

Chcę utworzyć dokument PDF z nagłówkiem i stopką na każdej stronie, nie wiem, dlaczego pojawiają się tylko na stronach nieparzystych.Nagłówek i stopka XSL FO

Upraszczam kod i tworzę stół, a ja kilkakrotnie powtarzałem, aby mieć 4 strony, ale wynik jest taki sam, nagłówek i stopka pojawiają się tylko na pierwszej i trzeciej stronie.

Oto kod. Wersja xsl to 1.0.

<xsl:output indent="yes"/> 

<xsl:template match ="template"> 
    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> 

    <fo:layout-master-set> 
<!-- layout information --> 
<fo:simple-page-master master-name="pagetemplate" 
       page-height="29.7cm" 
       page-width="21cm" 
       margin-top="1cm" 
       margin-bottom="0.1cm" 
       margin-left="0.8cm" 
       margin-right="1.0cm"> 
    <fo:region-body margin-top="2.5cm" margin-bottom="2.5cm"/> 
    <fo:region-before extent="2.0cm"/> 
    <fo:region-after extent="2.0cm"/> 
</fo:simple-page-master> 
</fo:layout-master-set> 

<fo:page-sequence master-reference="pagetemplate"> 

      <fo:static-content flow-name="xsl-region-before"> 
     <fo:block> 
      <xsl:call-template name="header"/> 
     </fo:block> 
     </fo:static-content> 

     <fo:static-content flow-name="xsl-region-after"> 
     <fo:block> 
     <xsl:call-template name="footer"/> 
     </fo:block> 
     </fo:static-content> 

     <fo:flow flow-name="xsl-region-body"> 

    <xsl:call-template name="block"/> 
      <xsl:call-template name="block"/> 
      <xsl:call-template name="block"/> 
      <xsl:call-template name="block"/> 

     </fo:flow> 

</fo:page-sequence> 

</fo:root> 

</xsl:template> 

Odpowiedz

2

Rozwiązuję problem.

Chodziło o to, że marginesy regionu-ciała, regionu przed i regionu-po były nieprawidłowe.

Powiązane problemy