addSection

addSection

BASIC / ADVANCED / PREMIUM

Inserts a new section into the Word document.

Description
public addSection ( string $sectionType [, string $paperType [, array $options ] ] ] )

This method allows the creation of new sections in your Word document.

This option is needed if you wish to change the page properties, for example, from portrait to landscape orientation in part of your Word document.

All content inserted after a call to this method will be incorporated into the new section.

Parameters

sectionType

These parameters determine the kind of break (if any) used. The possible values are:

  • nextPage (default value): the new section starts in a new page,
  • nextColumn: the new section starts in the following column,
  • continuous: there is no break between sections,
  • evenPage: the new section starts in the next available even page and
  • oddPage: the new section starts in the next available odd page.

paperType

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

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

options

This parameter is only required if the paperType parameter has been set up to custom.

key Type Description
width int Section width in twips (twentieths of a point).
height int Section height in twips.
numberCols int Number of columns for this section.
orient string Section page orientation (portrait or landscape).
marginTop int Top margin for this section in twips.
marginRight int Right margin for this section in twips.
marginBottom int Bottom margin for this section in twips.
marginLeft int Left margin for this section in twips.
marginHeader int Header margin in twips.
marginFooter int Footer margin in twips.
gutter string Gutter in twips (used for binding).
bidi string Set to 'on' for right to left languages (default value is 'off').
rtl string Set to 'on' for right to left languages (default value is 'off').
Return values

Void.

Code samples

Example #1