modifyPageLayout

modifyPageLayout

BASIC / ADVANCED / PREMIUM

Modifies the Word document layout.

Description
public void modifyPageLayout()
public void modifyPageLayout(String paperType)
public void modifyPageLayout(String paperType, OptionsPageLayout 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
  • custom

options

Option Type Description
width Integer Document width in twips (twentieths of a point).
height Integer Document height in twips (twentieths of a point).
numberCols Integer Number of columns.
orient String Page orientation (portrait or landscape).
marginTop Integer Top margin in twips (twentieths of a point).
marginRight Integer Right margin in twips (twentieths of a point).
marginBottom Integer Bottom margin in twips (twentieths of a point).
marginLeft Integer Left margin in twips (twentieths of a point).
marginHeader Integer Header margins in twips (twentieths of a point).
marginFooter Integer Footer margins in twips (twentieths of a point).
gutter Integer Gutter in twips (twentieths of a point). The gutter is only used for binding.
bidi Boolean Set to true for right to left languages.
rtlGutter Integer RTL gutter.
onlyLastSection Boolean If true it only modifies the last section (default value is false).
sectionNumbers ArrayList<String> An ArrayList with the sections that you want to modify.
Code samples

Example #1

The resulting Word document looks like:

Example #2

The resulting Word document looks like: