Page Header with 3 Parts

This section provides a tutorial example on how to generate page headers with 3 parts aligned to left, center and right separately. A table of one row and three cells is used.

If you want to make a page header with 3 parts aligned to left, center and right separately, you use a table formatting object instead of a single block as shown in this tutorial example,

<?xml version="1.0" encoding="utf-8"?>
 - Copyright (c) 2016,, All Rights Reserved.
<fo:root xmlns:fo="">
  <fo:simple-page-master master-name="my_page" 
   margin="0.1in" page-height="3.3in" page-width="2.55in">
   <fo:region-body region-name="my_body" background-color="#eeeeee"
   <fo:region-before region-name="my_header" 
    background-color="#ffeeee" extent="0.3in"/>
 <fo:page-sequence master-reference="my_page">
  <fo:static-content flow-name="my_header">
   <fo:block-container height="0.3in" display-align="after">
    <fo:table font-size="9pt"
     border-bottom-width="1px" border-bottom-style="solid">
        <fo:block >Tale 53</fo:block>
<fo:block text-align="center">Page <fo:page-number/></fo:block>
        <fo:block text-align="end">by A. Zick</fo:block>
  <fo:flow flow-name="my_body">
   <fo:block text-align="center" margin-top="6pt"
    font-weight="bold">Little Snow-White
   <fo:block text-align="justify" margin-top="6pt">
Once upon a time in midwinter, when the snowflakes were falling like 
feathers from heaven, a queen sat sewing at her window, which had a 
frame of black ebony wood. As she sewed she looked up at the snow and 
pricked her finger with her needle. Three drops of blood fell into the
snow. The red on the white looked so beautiful that she thought to 
herself, "If only I had a child as white as snow, as red as blood, 
and as black as the wood in this frame."
   <fo:block text-align="justify" margin-top="6pt">
Soon afterward she had a little daughter who was as white as snow, as 
red as blood, and as black as ebony wood, and therefore they called 
her Little Snow-White. And as soon as the child was born, the queen 

If you process this example XSL-FO document with Apache FOP to a PDF file, you will see more complex page headers:

Page Header with 3 Parts

Last update: 2016.

Table of Contents

 About This XSL-FO Tutorial Book

 Introduction of XSL-FO

 Apache™ FOP (Formatting Objects Processor)

 RenderX XEP as an XSL-FO Tool

 Introduction of Area Model

 XSL-FO Document Basics and Examples

 Page Layout Masters

 Block-Level Formatting Objects

 Inline-Level Formatting Objects

 Including Graphics in XSL-FO document

 Table of Rows and Columns

 List, Item, Label, and Body

 Floating Blocks - "float" and "footnote"

 Hyperlinks, Table of Contents and Indexes

Headers and Footers using "static-content"

 Page Header in region-before Area

Page Header with 3 Parts

 Page Footer with 3 Parts

 Page Headers for Multiple Chapters

 Font Attributes and Font Families

 Apache FOP Font Configurations

 RenderX XEP Font Configurations


 PDF Printing Version