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.
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.
Header and Footer

Learn how to customize your header and footer using easyDITA PDF customizations.
section
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 adding a:
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.
prereq
You have added a reference to a variable in your custom-xsl.xsl file, either by editing the header or footer template.
context

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> 
    

result
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/.