XML technologies / XSL-FO / Reference / Attributes in XSL-FO / leader-pattern

(Excerpt from "XSL-FO ― Die Referenz" by 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

Recommendation section: 7.22.2

Category: 7.22 Leader and Rule Properties

Description

The <fo:leader> element fills an inline area with particular characters. This leader is mainly used in tables of contents to achieve justified alignment. The leader-pattern attribute specifies the fill characters. It can use dots, spaces, or the content of <fo:leader>, or draw a line instead of fill characters.

Values

space

Spaces are used as fill characters.

rule

A leader line is drawn instead of fill characters.

dots

Dots are used as fill characters.

use-content

The content of <fo:leader> is used as the fill pattern. Its characters are repeated in sequence.

Inherited:

yes

Default value: space

XSL-FO version: 1.0

Allowed in:

<fo:leader>

This element creates a line of repeated characters to separate two text formatting objects, for example headings and their page numbers in a table of contents.

Support:

Conformance level

Antenna House

FOP

RenderX XEP

Altsoft XML2PDF

Compart DocBridge

Basic

Y

Y

Y

Y

Y

XSL-FO example:

<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" margin="0mm 0mm 0mm
                      0mm" page-height="150mm" page-width="148mm">
<fo:region-body margin="10mm 15mm 10mm
                        25mm"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="Inhalt-Seiten" font-size="10pt">
<fo:flow flow-name="xsl-region-body">
<fo:table page-break-after="always" width="100%" text-align-last="justify">
<fo:table-column column-width="110mm"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell number-columns-spanned="2">
<fo:block text-align="center">
Inhaltsverzeichnis
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell width="100%">
<fo:block>
Anfang 
<fo:inline>
<fo:leader rule-style="solid" rule-thickness="1pt" color="black" leader-pattern="use-content"/>
</fo:inline>
<fo:page-number-citation ref-id="anfang"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<fo:block>
Gregors Blick richtete sich dann zum Fenster 
<fo:inline>
<fo:leader leader-pattern="dots"/>
</fo:inline>
<fo:page-number-citation ref-id="anfang"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<fo:block>
Er glitt wieder
                in seine frühere Lage zurück
<fo:inline>
<fo:leader leader-pattern="space"/>
</fo:inline>
<fo:page-number-citation ref-id="anfang"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<fo:block>
Er glitt wieder in seine frühere Lage zurück
<fo:inline>
<fo:leader leader-pattern="use-content">
-
</fo:leader>
</fo:inline>
<fo:page-number-citation ref-id="anfang"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<fo:block>
Er glitt wieder
                in seine frühere Lage zurück
<fo:inline>
<fo:leader leader-pattern="use-content">
-|-
</fo:leader>
</fo:inline>
<fo:page-number-citation ref-id="anfang"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
<fo:block id="anfang">
Als Gregor Samsa eines Morgens aus unruhigen Träumen erwachte, fand er sich in
                seinem Bett zu einem ungeheueren Ungeziefer verwandelt. Er lag auf seinem
                panzerartig harten Rücken und sah, wenn er den Kopf ein wenig hob, seinen gewölbten,
                braunen, von bogenförmigen Versteifungen geteilten Bauch, auf dessen Höhe sich die
                Bettdecke, zum gänzlichen Niedergleiten bereit, kaum noch erhalten konnte. Seine
                vielen, im Vergleich zu seinem sonstigen Umfang kläglich dünnen Beine flimmerten ihm
                hilflos vor den Augen.
</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>

Download the examples

In the output:

Page 2

Excerpt from the W3C Recommendation:

More information online about

Rendering of the property in the XSL-FO reference

back to top