addFooter

addFooter

TRIAL / ADVANCED / PREMIUM

Inserts footers into the Word document.

Description
public addFooter ( array $footers )

It is possible to include a different footer for:

  • the first page or title page.
  • even pages.
  • odd pages (this one is the default footer for the whole document if no other footers are defined for the first or even pages).

The contents of the different footers are defined via the use of WordFragments. These footer 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 footers of an existing DOCX document via the ImportHeadersAndFooters method.

This method adds new footers into all sections, removing existing footers. The addFooterSection method allows adding footers per section.

Parameters

footers

An array with the different footer contents.

key Type Description
default WordFragment The WordFragment object containing the contents for the default (odd pages) footer.
even WordFragment The WordFragment object containing the contents for the even pages footer.
first WordFragment The WordFragment object containing the contents for the first (title) page footer.
Exceptions

Not using WordFragments.

Code samples

Example #1

The resulting Word document looks like:

Example #2

The resulting Word document looks like this: