mPDF Manual – mPDF functions

SetFooter()

(mPDF >= 1.0)

SetFooter – Sets a page header

Description

void SetFooter ([ mixed $footer [, string $side ]])

Set a page footer.

Parameters

$footer

This parameter specifies the content of the page footer. It can accept a string or array. If a BLANK string or NULL or array() is passed, this will clear the page footer.

DEFAULT: array()

Values

A simple text string is set as content for the RIGHT margin. If DOUBLE-SIDED document, this is mirrored on EVEN pages i.e. LEFT margin.

A text string containing 2 characters ‘ ’ - will be split into three strings and set as content for the left centre right parts of the footer e.g. $header=’‘Chapter 1 {PAGENO} Book Title”.
If DOUBLE-SIDED document, this is mirrored on EVEN pages i.e. right centre left.

An array can be in two forms. The first form includes information for both ODD and EVEN footers, and is the expected form if  $side = BLANK.

Values

$content: TEXT STRING

$font-size: FLOAT font size in pts

$font-style: B I BI BLANK STRING

$font-family: Any available font-family

$color: CSS ‘#RRGGBB’ string

$line: 0 1 - specify whether to draw a line above the Footer
$footer = array (

  'odd' => array (

    'L' => array (

      'content' => '',

      'font-size' => 10,

      'font-style' => 'B',

      'font-family' => 'serif',

      'color'=>'#000000'

    ),

    'C' => array (

      'content' => '',

      'font-size' => 10,

      'font-style' => 'B',

      'font-family' => 'serif',

      'color'=>'#000000'

    ),

    'R' => array (

      'content' => 'My document',

      'font-size' => 10,

      'font-style' => 'B',

      'font-family' => 'serif',

      'color'=>'#000000'

    ),

    'line' => 1,

  ),

  'even' => array ()

);
The second form includes information for either ODD or EVEN footers, and must be accompanied by a valid value for $side = O E
$footer = array (

    'L' => array (

      'content' => '',

      'font-size' => 10,

      'font-style' => 'B',

      'font-family' => 'serif',

      'color'=>'#000000'

    ),

    'C' => array (

      'content' => '',

      'font-size' => 10,

      'font-style' => 'B',

      'font-family' => 'serif',

      'color'=>'#000000'

    ),

    'R' => array (

      'content' => 'My document',

      'font-size' => 10,

      'font-style' => 'B',

      'font-family' => 'serif',

      'color'=>'#000000'

    ),

    'line' => 1,

);

$side

Specify whether to set the footer for ODD or EVEN pages in a DOUBLE-SIDED document.

DEFAULT: BLANK

Values (case-sensitive)

O - set the footer for ODD pages

E - set the footer for EVEN pages

BLANK - sets both ODD or EVEN page footers

Changelog

VersionDescription
2.0 The $side parameter was added.

Examples

For examples and further information please see:

See Also