Technologies XML / XSL-FO / Référence / Attributs de XSL-FO / page-position

(Extrait de « XSL-FO ― Die Referenz » de Manuel Montero Pineda & Steffen Herkert, 2016, dpunkt.verlag)

A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z

Section de la recommandation : 7.27.14

Catégorie : 7.27 Propriétés de pagination et de mise en page

Description

Les éléments <fo:conditional-page-master-reference> décrivent une séquence de pages dans <fo:repeatable-page-master-alternatives>. Un <fo:conditional-page-master-reference> référence un modèle de page. L’attribut page-position précise où ce modèle peut être utilisé dans le document produit : première page, dernière page, autres pages ou toutes les pages. Associé à odd-or-even, il permet plusieurs modèles de même valeur page-position dans <fo:repeatable-page-master-alternatives>.

Valeurs

first

Le modèle ne peut être utilisé que pour la première page.

last

Le modèle ne peut être utilisé que pour la dernière page.

rest

Le modèle est utilisé pour toutes les pages sauf la première et la dernière.

any

Le modèle peut être utilisé pour toute page sans autre modèle applicable.

only

Le modèle ne doit comporter qu’une page, qui est donc à la fois la première et la dernière. Dans ce cas, la valeur only peut être utilisée.

Hérité :

oui

Valeur par défaut : any

Version XSL-FO : 1.0

Autorisé dans :

<fo:conditional-page-master-reference>

Cet élément nomme un objet gabarit de page à utiliser lorsque les conditions requises sont réunies.

Prise en charge :

Niveau de conformité

Antenna House

FOP

RenderX XEP

Altsoft XML2PDF

Compart DocBridge

Étendu

O

O

O

P

O

Exemple XSL-FO :

<fo:root font-family="Arial" font-size="10pt" line-height="1.2em" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:cpfo="http://www.compart.net/xmlns/cpfo" xmlns:svg="http://www.w3.org/2000/svg" xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions">
<fo:layout-master-set>
<fo:simple-page-master master-name="Inhalt-Seiten.first" margin="0mm 0mm 0mm
                      0mm" page-height="auto" page-width="auto">
<fo:region-body margin="20mm 15mm 5mm
                        25mm"/>
<fo:region-before extent="5mm" region-name="first.before"/>
</fo:simple-page-master>
<fo:simple-page-master master-name="Inhalt-Seiten.rest" margin="0mm 0mm 0mm
                      0mm" page-height="auto" page-width="auto">
<fo:region-body margin="20mm 15mm 5mm
                        25mm"/>
<fo:region-before extent="5mm" region-name="rest.before"/>
</fo:simple-page-master>
<fo:simple-page-master master-name="Inhalt-Seiten.last" margin="0mm 0mm 0mm
                      0mm" page-height="auto" page-width="auto">
<fo:region-body margin="20mm 15mm 5mm
                        25mm"/>
<fo:region-before extent="5mm" region-name="last.before"/>
</fo:simple-page-master>
<fo:simple-page-master master-name="Inhalt-Seiten.any" margin="0mm 0mm 0mm
                      0mm" page-height="auto" page-width="auto">
<fo:region-body margin="20mm 15mm 5mm
                        25mm"/>
<fo:region-before extent="5mm" region-name="any.before"/>
</fo:simple-page-master>
<fo:page-sequence-master master-name="Inhalt-Seiten.master">
<fo:repeatable-page-master-alternatives>
<fo:conditional-page-master-reference master-reference="Inhalt-Seiten.rest" page-position="rest"/>
<fo:conditional-page-master-reference master-reference="Inhalt-Seiten.first" page-position="first"/>
<fo:conditional-page-master-reference master-reference="Inhalt-Seiten.last" page-position="last"/>
</fo:repeatable-page-master-alternatives>
</fo:page-sequence-master>
<fo:page-sequence-master master-name="Inhalt-Seiten.master2">
<fo:repeatable-page-master-alternatives>
<fo:conditional-page-master-reference master-reference="Inhalt-Seiten.rest" page-position="rest"/>
<fo:conditional-page-master-reference master-reference="Inhalt-Seiten.any" page-position="any"/>
</fo:repeatable-page-master-alternatives>
</fo:page-sequence-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="Inhalt-Seiten.master" font-size="10pt">
<fo:static-content flow-name="first.before">
<fo:block margin-top="2mm" text-align="center" font-size="16pt">
 Seitenvorlage
              
<fo:inline font-weight="700">
erste Seite
</fo:inline>
;
                page-position="
<fo:inline font-weight="700">
first
</fo:inline>
" 
</fo:block>
</fo:static-content>
<fo:static-content flow-name="rest.before">
<fo:block margin-top="2mm" text-align="center" font-size="16pt">
 Seitenvorlage: 
<fo:inline font-weight="700">
übrige Seiten
</fo:inline>
; page-position="
<fo:inline font-weight="700">
rest
</fo:inline>
" 
</fo:block>
</fo:static-content>
<fo:static-content flow-name="last.before">
<fo:block margin-top="2mm" text-align="center" font-size="16pt">
 Seitenvorlage:
              
<fo:inline font-weight="700">
letzte Seite
</fo:inline>
;
                page-position="
<fo:inline font-weight="700">
last
</fo:inline>
" 
</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
<fo:block page-break-after="always">
Inhalt 1. Seitenfolge
</fo:block>
<fo:block page-break-after="always">
Inhalt 1.
                Seitenfolge
</fo:block>
<fo:block page-break-after="always">
Inhalt 1. Seitenfolge
</fo:block>
<fo:block page-break-after="always">
Inhalt 1.
                Seitenfolge
</fo:block>
<fo:block page-break-after="always">
Inhalt 1. Seitenfolge
</fo:block>
<fo:block page-break-after="always">
Inhalt 1.
                Seitenfolge
</fo:block>
<fo:block page-break-after="always">
Inhalt 1. Seitenfolge
</fo:block>
</fo:flow>
</fo:page-sequence>
<fo:page-sequence master-reference="Inhalt-Seiten.master2" font-size="10pt">
<fo:static-content flow-name="rest.before">
<fo:block margin-top="2mm" text-align="center" font-size="16pt">
 Seitenvorlage:
              
<fo:inline font-weight="700">
übrige Seiten
</fo:inline>
;
                page-position="
<fo:inline font-weight="700">
rest
</fo:inline>
" 
</fo:block>
</fo:static-content>
<fo:static-content flow-name="any.before">
<fo:block margin-top="2mm" text-align="center" font-size="16pt">
 Seitenvorlage: 
<fo:inline font-weight="700">
alle Seiten
</fo:inline>
; page-position="
<fo:inline font-weight="700">
any
</fo:inline>
" 
</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
<fo:block page-break-after="always">
Inhalt 2.
                Seitenfolge
</fo:block>
<fo:block page-break-after="always">
Inhalt 2. Seitenfolge
</fo:block>
<fo:block page-break-after="always">
Inhalt 2.
                Seitenfolge
</fo:block>
<fo:block>
Inhalt 2. Seitenfolge
</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>

Télécharger les exemples

Dans la sortie :

Page 2

Page 3

Page 4

Page 5

Page 6

Page 7

Page 8

Page 9

Page 10

Page 11

Extrait de la recommandation du W3C :

Informations complémentaires en ligne sur

Introduction : « Mise en page »>

Exemple pratique : « Gabarits de page et gabarits simples de séquences de pages »>

Exemple pratique : « Gabarits complexes de séquences de pages »>

Exemple pratique : « Pages à plusieurs colonnes avec filets de séparation »>

Présentation de la propriété dans la référence XSL-FO

haut de page