modifyPageLayout

modifyPageLayout

BASIC / ADVANCED / PREMIUM

Modifies the Word document layout.

Description
public modifyPageLayout ( string $paperType [ array $options )

This method modifies the main layout properties of the Word document like paper type size and margins.

Parameters

paperType

The type of paper to be used. The possible values are:

  • A4,
  • A3,
  • letter,
  • legal,
  • A4-landscape,
  • A3-landscape,
  • letter-landscape,
  • legal-landscape or
  • custom.

options

The possible keys and values are:

key Type Description
width int Document width in twips (twentieths of a point).
height int Document height in twips (twentieths of a point).
numberCols int Number of columns.
orient string Page orientation (portrait or landscape).
marginTop int Top margin in twips (twentieths of a point).
marginRight int Right margin in twips (twentieths of a point).
marginBottom int Bottom margin in twips (twentieths of a point).
marginLeft int Left margin in twips (twentieths of a point).
marginHeader int Header margins in twips (twentieths of a point).
marginFooter int Footer margins in twips (twentieths of a point).
gutter bool Gutter in twips (twentieths of a point). The gutter is only used for binding.
bidi string Set to 'on' for right to left languages (default value is 'off').
rtlGutter string Set to 'on' for right to left languages (default value is 'off').
onlyLastSection bool If true it only modifies the last section (default value is false).
sectionNumbers array An array with the sections that we want to modify.
Return values

Void.

Code samples

Example #1

The resulting Word document looks like:

Example #2

The resulting Word document looks like: