Table of Contents
More Resources
Adding a Custom Header and Footer
Header and Footer
Learn how to customize your header and footer using easyDITA PDF customizations.
Adding a Header
Header, Editing a Header Template, Adding Header Attributes, Adding a Background Color, Adjusting the Header Size
Setting Global Variables
You should use global variables for any static content (located on the cover page, header, or footer) so that it will be translated appropriately if you are publishing content in multiple languages.
Adding a Footer
Footer, Editing a Footer Template, Adding Footer Attributes, Adjusting the Footer Size
Total Page Number
Total Page Number, Calculating the Total Number of Pages, Updating the ‘Custom Page Number’ Variable
Header and Footer

Learn how to customize your header and footer using easyDITA PDF customizations.
You can add a custom header and footer to your content pages or Table of Contents page when publishing to PDF. This guide will show you how to customize your PDF output by:
Setting Global Variables

You should use global variables for any static content (located on the cover page, header, or footer) so that it will be translated appropriately if you are publishing content in multiple languages.
You have added a reference to a variable in your custom-xsl.xsl file (either by Editing a Footer Template guide or Editing a Header Template.
You want to define global variables to display custom text so that they will translate appropriately.
  1. Create a new file called en.xml located in your cfg/common/vars folder within your custom plugin. It should have the following contents to start:

    Step Information
    < ?xml version="1.0" encoding="UTF-8"?>  < vars xmlns="http://www.idiominc.com/opentopic/vars">        < !-- Add custom variable nodes here -->     < /vars> 
  2. Below is the basic form of a variable. Everything is wrapped in a < variable> element and the content within that can have < param> elements that correspond to values passed in when the insertVariable template is called.

    Step Information
    < variable id="[variable.name]">    [desired.text.content] < /variable> 
    Example
    < variable id="Custom Page Number">    Page < param ref-name="pagenum"/>  < /variable> 
  3. If you arrived here from the Editing a Footer Template guide, you’ll also need to declare the “Custom Footer Text” variable. Add the following code to the top of the en.xml file:

    Step Information
    < variable id="Custom Footer Text"> 
      [desired.text.content]
    < /variable> 
    

You have set up your required variables. Be sure to also set the values in any other languages by creating and editing xml files with names corresponding to the languages (de.xml, fr.xml, etc). You can see examples in org.dita.pdf2/cfg/common/vars/.