XML API - pdx:addHeader

pdx:addHeader

Inserts headers into the Word document.

Note

You are reading the XML API documentation. For the PHP API method please go to addHeader.

Description

Element definition

It is possible to include different headers for:

  • the first page or title page.
  • even pages.
  • odd pages (this one is the default header for the whole document if no different headers are defined for the first or even pages).

The contents of the different headers are defined via the use of WordFragments. These header WordFragments allow the insertion of:

  • text paragraphs
  • current date and/or hour
  • images
  • links
  • lists
  • page numbers
  • shapes
  • tables
  • HTML content

You may also import the headers of an existing DOCX document via the ImportHeadersAndFooters method.

Attributes and sub-elements

headers

Key Description
default The WordML fragment object containing the contents for the default (odd pages) header.
even The WordML fragment object containing the contents for the even pages header.
first The WordML fragment object containing the contents for the first (title) page header.
Code samples

Example #1

config.xml

content.xml

settings.xml

PHP code

The resulting Word document looks like: