XSL-FO Tutorials - Herong's Tutorial Examples - Version 2.10, by Dr. Herong Yang
"footnote" Formatting Object
This section provides a tutorial example on how to use a 'footnote' formatting object to create an inline footnote citation and a footnote content block floated to the bottom edge of the page. This will reduce the height of the region-body content area on the page.
Notice that XSL-FO does not allow a block to be floated to the "after" edge of the page. This is because the "after" edge is reserved to supported another kind of floating blocks generated by "footnote" formatting objects.
What Is "footnote" Formatting Object? "footnote" is an inline-level formatting object that generates two areas:
The XML structure of a "footnote" formatting object look this:
<footnote> <inline>...footnote citation...</inline> <footnote-body> <block>...footnote content...</block> </footnote-body> </footnote>
Note that the "footnote-body" formatting object is block-level formatting object that wraps blocks into a bigger block to be floated to the "after" edge of the page
Here is my tutorial example, footnote-Formatting-Object.fo, that creates a footnote citation at the end of the title text and the related footnote content:
<?xml version="1.0" encoding="utf-8"?> <!-- footnote-Formatting-Object.fo - Copyright (c) 2016, HerongYang.com, All Rights Reserved. --> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> <fo:layout-master-set> <fo:simple-page-master master-name="page" margin="0.08in" margin-bottom="0.2in" page-height="3in" page-width="2.5in"> <fo:region-body region-name="body" background-color="#eeeeee"/> </fo:simple-page-master> </fo:layout-master-set> <fo:page-sequence master-reference="page"> <fo:flow flow-name="body"> <fo:block margin="0.08in" font-size="10pt"> The Three Little Pigs <fo:footnote> <fo:inline baseline-shift="super" font-size="5pt" background-color="#ffccff">>></fo:inline> <fo:footnote-body> <fo:block font-size="5pt" background-color="#ffccff" padding="0.08in" margin="0in">>> Appeared in English Fairy Tales by Joseph Jacobs, first published in 1890. </fo:block> </fo:footnote-body> </fo:footnote> </fo:block> <fo:block margin="0.08in" font-size="8pt" text-align="justify"> Once upon a time there was not one, not two but three little pigs who lived with their mother. Early one morning they woke up and their mother said "you're too big for this house and it is time you left home." </fo:block> <fo:block margin="0.08in" font-size="8pt" text-align="justify"> So they walked and they walked and they walked. The first little pig made a house out of straw. Unfortunately, a wolf came creeping by. </fo:block> <fo:block margin="0.08in" font-size="8pt" text-align="justify"> "Little pig, little pig, let me come in". "No, no, no by the hairs of my chinny chin chin I will not let you in". "Then I'll huff and I'll puff and I'll blow your house down". So the wolf huffed and he puffed and he blew the house down. </fo:block> <fo:block margin="0.08in" font-size="8pt" text-align="justify"> So the first little pig ran away to find his brothers. </fo:block> </fo:flow> </fo:page-sequence> </fo:root>
Since Apache FOP 2.1 does support "footnote" formatting objects, you can use it to process the above example. The resulting PDF file has 2 pages as shown in the picture below:
Last update: 2016.
Table of Contents