XSL FO Header and Footer

I want to create a PDF document with a header and footer on all pages, I don't know why they appear only on odd pages.

I simplify the code and I create a table and I repeated several times to have 4 pages, but the result is the same, the header and footer are displayed only on the first and third page.

Here is the code. Xsl version 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> 
+6
source share
1 answer

I am solving a problem.

The fact is that the fields of the region-body, region-do, and region-then were wrong.

+2
source

Source: https://habr.com/ru/post/921749/