Movatterモバイル変換


[0]ホーム

URL:


mPDF Manual – mPDF functions

SetFooter()

(mPDF ≥ 1.0)

SetFooter – Sets a page footer

Description

voidSetFooter ([ mixed$footer [, string$side ]])

Set a page footer.

Note: This function/method was altered in mPDF 2.2 by capitalising the first letter of the name. As function/method names in PHP have hitherto been case-insensitive, this should not cause any problems, but it is recommended where possible to use the preferred spelling.

Parameters

$footer

This parameter specifies the content of the page footer. It can accept a string or array.

Default:array()

Values
'' (BLANK string) ornull orarray()
This will clear the page footer.
TEXT STRING
A simple text string is set as content for theRIGHT margin. IfDOUBLE-SIDED document, this is mirrored onEVENpages i.e.LEFT margin.

A text string containing 2 characters| - will be split into three strings and set as content for, respectively, theleft | centre | right parts of the footer

e.g.$footer = 'Chapter 1|{PAGENO}|Book Title'.

IfDOUBLE-SIDED document, this is mirrored onEVENpages i.e.right|centre|left.

ARRAY
An array can be in two forms:
  • (Deprecated) The first form includes information for bothODD andEVENfooters, and is the expected formif$side =BLANK.

    Values

    • 'odd': subarray forODD
    • 'even': subarray forEVEN

      Subarray with following entries:

      • 'L': subarray for left
      • 'C': subarray for center
      • 'R': subarray for right

        Subarray with following entries:

        • 'content':TEXT STRING
        • 'font-size':FLOAT font size inpts
        • '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

    Example:

    <?php$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 eitherODD orEVEN footers, and must be accompanied by a valid value for$side'O' |'E'

    Example:

    <?php$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 forODD orEVENpages in aDOUBLE-SIDED document.

Default:BLANK

Values (case-sensitive)

  • O - set the footer forODD pages
  • E - set the footer forEVEN pages
  • BLANK - sets bothODD orEVEN page footers

Changelog

VersionDescription
2.0The$side parameter was added.

Examples

For examples and further information please see:

See Also


[8]ページ先頭

©2009-2026 Movatter.jp