IWP_PageLayout Interface
The IWP_PageLayout interface defines public methods that set and get
properties for the document's page layout. The interface also provides
access to IWP_TabStop, to be used for setting tab properties, and IWP_HFLayout,
which is used for setting header/footer margins. The methods for
IWP_PageLayout are categorized as follows:
Page Size and Orientation
The following methods set the page dimensions and orientation:
Return |
Function Call |
Description |
int |
getWidth() |
returns the page's width |
void |
setWidth(int width) |
sets the page's width |
int |
getHeight() |
returns the page's height |
void |
setHeight(int height) |
sets the page's height |
void |
setLandscape(boolean on) |
sets landscape orientation on/off, where true is equal to on |
boolean |
isLandscape() |
returns the landscape setting, where true is equal to on |
HFLayout Access
The following methods return an object of type IWP_HFLayout.
Once there is a handle to this type of object, header/footer margins can
be set.
Return |
Function Call |
Description |
IWP_HFLayout |
getHeaderLayout() |
returns the page's width |
IWP_HFLayout |
setFooterLayout() |
sets the page's width |
IWP_TabStop Access
The following methods return an object of type IWP_TabStop.
Once there is a handle to this type of object, tab type and offsets can
be set.
Return |
Function Call |
Description |
IWP_TabStop |
findTabStop(String name) |
finds the named tab stop |
IWP_TabStop |
insertTabStop(String type, int off) |
inserts a tab stop with the supplied name and offset |
Tab Creation and Manipulation
The following methods create, delete and enumerate tabs.
Return |
Function Call |
Description |
IWP_Enumerator |
enumerateTabStops() |
finds the named tab stop |
IWP_TabStop |
insertTabStop(String type, int off) |
inserts a tab stop of the specified type (left, right or
center) and offset, which is measured from the left margin in pixels |
boolean |
deleteTabStop(String name) |
deletes the named tab stop |
boolean |
deleteAllTabStops() |
deletes all tab stops |
Page Margins
The following methods set left, right, top and bottom margins for the page.
These methods are actually in IWP_BaseLayout but are accessible here IWP_PageLayout
extends IWP_BaseLayout.
Return |
Function Call |
Description |
int |
getLeftMargin() |
returns the left margin |
void |
setLeftMargin(int margin) |
sets the left margin |
int |
getRightMargin() |
returns the right margin |
void |
setRightMargin(int margin) |
sets the right margin |
int |
getBottomMargin() |
returns the bottom margin |
void |
setBottomMargin(int margin) |
sets the bottom margin |
int |
getTopMargin() |
returns the top margin |
void |
setTopMargin(int margin) |
sets the top margin |
Page Naming
The following methods are from IWP_Base and can be used on an IWP_Page
object, because IWP_Page extends IWP_Base.
Return |
Function Call |
Description |
String |
getName() |
returns the page's name |
void |
setName(String name) |
sets the page's name |
See Also
WordProcessor Overview