public class PageSetup
extends java.lang.Object
PageSetup object contains all the page setup attributes of a section (left margin, bottom margin, paper size, and so on) as properties.
| Modifier and Type | Method and Description |
|---|---|
void |
clearFormatting()
Resets page setup to default paper size, margins and orientation.
|
java.lang.Object |
fetchInheritedBorderAttr(int key) |
boolean |
getBidi()
Specifies that this section contains bidirectional (complex scripts) text.
|
boolean |
getBorderAlwaysInFront()
Specifies where the page border is positioned relative to intersecting texts and objects.
|
int |
getBorderAppliesTo()
Specifies which pages the page border is printed on.
|
int |
getBorderDistanceFrom()
Gets a value that indicates whether the specified page border is measured from the edge of the page or from the text it surrounds.
|
BorderCollection |
getBorders()
Gets a collection of the page borders.
|
boolean |
getBorderSurroundsFooter()
Specifies whether the page border includes or excludes the footer.
|
boolean |
getBorderSurroundsHeader()
Specifies whether the page border includes or excludes the header.
|
double |
getBottomMargin()
Gets the distance (in points) between the bottom edge of the page and the bottom boundary of the body text.
|
int |
getChapterPageSeparator()
Gets the separator character that appears between the chapter number and the page number.
|
int |
getCharactersPerLine()
Gets the number of characters per line in the document grid.
|
boolean |
getDifferentFirstPageHeaderFooter()
True if a different header or footer is used on the first page.
|
java.lang.Object |
getDirectBorderAttr(int key) |
EndnoteOptions |
getEndnoteOptions()
Provides options that control numbering and positioning of endnotes in this section.
|
int |
getFirstPageTray()
Gets the paper tray (bin) to use for the first page of a section.
|
double |
getFooterDistance()
Gets the distance (in points) between the footer and the bottom of the page.
|
FootnoteOptions |
getFootnoteOptions()
Provides options that control numbering and positioning of footnotes in this section.
|
double |
getGutter()
Gets the amount of extra space added to the margin for document binding.
|
double |
getHeaderDistance()
Gets the distance (in points) between the header and the top of the page.
|
int |
getHeadingLevelForChapter()
Gets the heading level style that is applied to the chapter titles in the document.
|
int |
getLayoutMode()
Gets the layout mode of this section.
|
double |
getLeftMargin()
Gets the distance (in points) between the left edge of the page and the left boundary of the body text.
|
int |
getLineNumberCountBy()
Gets the numeric increment for line numbers.
|
double |
getLineNumberDistanceFromText()
Gets distance between the right edge of line numbers and the left edge of the document.
|
int |
getLineNumberRestartMode()
Gets the way line numbering runs that is, whether it starts over at the beginning of a new page or section or runs continuously.
|
int |
getLinesPerPage()
Gets the number of lines per page in the document grid.
|
int |
getLineStartingNumber()
Gets the starting line number.
|
int |
getMultiplePages()
For multiple page documents, gets or sets how a document is printed or rendered so that it can be bound as a booklet.
|
boolean |
getOddAndEvenPagesHeaderFooter()
True if the document has different headers and footers for odd-numbered and even-numbered pages.
|
int |
getOrientation()
Gets the orientation of the page.
|
int |
getOtherPagesTray()
Gets the paper tray (bin) to be used for all but the first page of a section.
|
double |
getPageHeight()
Gets the height of the page in points.
|
int |
getPageNumberStyle()
Gets the page number format.
|
int |
getPageStartingNumber()
Gets the starting page number of the section.
|
double |
getPageWidth()
Gets the width of the page in points.
|
int |
getPaperSize()
Gets the paper size.
|
boolean |
getRestartPageNumbering()
True if page numbering restarts at the beginning of the section.
|
double |
getRightMargin()
Gets the distance (in points) between the right edge of the page and the right boundary of the body text.
|
boolean |
getRtlGutter()
Gets whether Microsoft Word uses gutters for the section based on a right-to-left language or a left-to-right language.
|
int |
getSectionStart()
Gets the type of section break for the specified object.
|
int |
getSheetsPerBooklet()
Gets the number of pages to be included in each booklet.
|
boolean |
getSuppressEndnotes()
True if endnotes are printed at the end of the next section that doesn't suppress endnotes.
|
TextColumnCollection |
getTextColumns()
Returns a collection that represents the set of text columns.
|
int |
getTextOrientation()
Allows to specify
getTextOrientation() / setTextOrientation(int) for the whole page. |
double |
getTopMargin()
Gets the distance (in points) between the top edge of the page and the top boundary of the body text.
|
int |
getVerticalAlignment()
Gets the vertical alignment of text on each page in a document or section.
|
void |
setBidi(boolean value)
Specifies that this section contains bidirectional (complex scripts) text.
|
void |
setBorderAlwaysInFront(boolean value)
Specifies where the page border is positioned relative to intersecting texts and objects.
|
void |
setBorderAppliesTo(int value)
Specifies which pages the page border is printed on.
|
void |
setBorderAttr(int key,
java.lang.Object value) |
void |
setBorderDistanceFrom(int value)
Sets a value that indicates whether the specified page border is measured from the edge of the page or from the text it surrounds.
|
void |
setBorderSurroundsFooter(boolean value)
Specifies whether the page border includes or excludes the footer.
|
void |
setBorderSurroundsHeader(boolean value)
Specifies whether the page border includes or excludes the header.
|
void |
setBottomMargin(double value)
Sets the distance (in points) between the bottom edge of the page and the bottom boundary of the body text.
|
void |
setChapterPageSeparator(int value)
Sets the separator character that appears between the chapter number and the page number.
|
void |
setCharactersPerLine(int value)
Sets the number of characters per line in the document grid.
|
void |
setDifferentFirstPageHeaderFooter(boolean value)
True if a different header or footer is used on the first page.
|
void |
setFirstPageTray(int value)
Sets the paper tray (bin) to use for the first page of a section.
|
void |
setFooterDistance(double value)
Sets the distance (in points) between the footer and the bottom of the page.
|
void |
setGutter(double value)
Sets the amount of extra space added to the margin for document binding.
|
void |
setHeaderDistance(double value)
Sets the distance (in points) between the header and the top of the page.
|
void |
setHeadingLevelForChapter(int value)
Sets the heading level style that is applied to the chapter titles in the document.
|
void |
setLayoutMode(int value)
Sets the layout mode of this section.
|
void |
setLeftMargin(double value)
Sets the distance (in points) between the left edge of the page and the left boundary of the body text.
|
void |
setLineNumberCountBy(int value)
Sets the numeric increment for line numbers.
|
void |
setLineNumberDistanceFromText(double value)
Sets distance between the right edge of line numbers and the left edge of the document.
|
void |
setLineNumberRestartMode(int value)
Sets the way line numbering runs that is, whether it starts over at the beginning of a new page or section or runs continuously.
|
void |
setLinesPerPage(int value)
Sets the number of lines per page in the document grid.
|
void |
setLineStartingNumber(int value)
Sets the starting line number.
|
void |
setMultiplePages(int value)
For multiple page documents, gets or sets how a document is printed or rendered so that it can be bound as a booklet.
|
void |
setOddAndEvenPagesHeaderFooter(boolean value)
True if the document has different headers and footers for odd-numbered and even-numbered pages.
|
void |
setOrientation(int value)
Sets the orientation of the page.
|
void |
setOtherPagesTray(int value)
Sets the paper tray (bin) to be used for all but the first page of a section.
|
void |
setPageHeight(double value)
Sets the height of the page in points.
|
void |
setPageNumberStyle(int value)
Sets the page number format.
|
void |
setPageStartingNumber(int value)
Sets the starting page number of the section.
|
void |
setPageWidth(double value)
Sets the width of the page in points.
|
void |
setPaperSize(int value)
Sets the paper size.
|
void |
setRestartPageNumbering(boolean value)
True if page numbering restarts at the beginning of the section.
|
void |
setRightMargin(double value)
Sets the distance (in points) between the right edge of the page and the right boundary of the body text.
|
void |
setRtlGutter(boolean value)
Sets whether Microsoft Word uses gutters for the section based on a right-to-left language or a left-to-right language.
|
void |
setSectionStart(int value)
Sets the type of section break for the specified object.
|
void |
setSheetsPerBooklet(int value)
Sets the number of pages to be included in each booklet.
|
void |
setSuppressEndnotes(boolean value)
True if endnotes are printed at the end of the next section that doesn't suppress endnotes.
|
void |
setTextOrientation(int value)
Allows to specify
getTextOrientation() / setTextOrientation(int) for the whole page. |
void |
setTopMargin(double value)
Sets the distance (in points) between the top edge of the page and the top boundary of the body text.
|
void |
setVerticalAlignment(int value)
Sets the vertical alignment of text on each page in a document or section.
|
public void clearFormatting()
public boolean getOddAndEvenPagesHeaderFooter()
boolean value.public void setOddAndEvenPagesHeaderFooter(boolean value)
value - The corresponding boolean value.public boolean getDifferentFirstPageHeaderFooter()
boolean value.public void setDifferentFirstPageHeaderFooter(boolean value)
value - The corresponding boolean value.public int getMultiplePages()
int value. The returned value is one of MultiplePagesType constants.public void setMultiplePages(int value)
value - The corresponding int value. The value must be one of MultiplePagesType constants.public int getSheetsPerBooklet()
public void setSheetsPerBooklet(int value)
value - The number of pages to be included in each booklet.public int getSectionStart()
SectionStart constants.public void setSectionStart(int value)
value - The type of section break for the specified object. The value must be one of SectionStart constants.public boolean getSuppressEndnotes()
boolean value.public void setSuppressEndnotes(boolean value)
value - The corresponding boolean value.public int getVerticalAlignment()
PageVerticalAlignment constants.public void setVerticalAlignment(int value)
value - The vertical alignment of text on each page in a document or section. The value must be one of PageVerticalAlignment constants.public boolean getBidi()
When true, the columns in this section are laid out from right to left.
boolean value.public void setBidi(boolean value)
When true, the columns in this section are laid out from right to left.
value - The corresponding boolean value.public int getLayoutMode()
SectionLayoutMode constants.public void setLayoutMode(int value)
value - The layout mode of this section. The value must be one of SectionLayoutMode constants.public int getCharactersPerLine()
Minimum value of the property is 1. Maximum value depends on page width and font size of the Normal style. Minimum character pitch is 90 percent of the font size. For example, maximum number of characters per line of a Letter page with one-inch margins is 43.
By default, the property has a value, on which character pitch equals to font size of the Normal style.
public void setCharactersPerLine(int value)
Minimum value of the property is 1. Maximum value depends on page width and font size of the Normal style. Minimum character pitch is 90 percent of the font size. For example, maximum number of characters per line of a Letter page with one-inch margins is 43.
By default, the property has a value, on which character pitch equals to font size of the Normal style.
value - The number of characters per line in the document grid.public int getLinesPerPage()
Minimum value of the property is 1. Maximum value depends on page height and font size of the Normal style. Minimum line pitch is 136 percent of the font size. For example, maximum number of lines per page of a Letter page with one-inch margins is 39.
By default, the property has a value, on which line pitch is in 1.5 times greater than font size of the Normal style.
public void setLinesPerPage(int value)
Minimum value of the property is 1. Maximum value depends on page height and font size of the Normal style. Minimum line pitch is 136 percent of the font size. For example, maximum number of lines per page of a Letter page with one-inch margins is 39.
By default, the property has a value, on which line pitch is in 1.5 times greater than font size of the Normal style.
value - The number of lines per page in the document grid.public double getPageWidth()
public void setPageWidth(double value)
value - The width of the page in points.public double getPageHeight()
public void setPageHeight(double value)
value - The height of the page in points.public int getPaperSize()
Setting this property updates getPageWidth() / setPageWidth(double) and getPageHeight() / setPageHeight(double) values. Setting this value to PaperSize.CUSTOM does not change existing values.
PaperSize constants.public void setPaperSize(int value)
Setting this property updates getPageWidth() / setPageWidth(double) and getPageHeight() / setPageHeight(double) values. Setting this value to PaperSize.CUSTOM does not change existing values.
value - The paper size. The value must be one of PaperSize constants.public int getOrientation()
Changing Orientation swaps getPageWidth() / setPageWidth(double) and getPageHeight() / setPageHeight(double).
Orientation constants.public void setOrientation(int value)
Changing Orientation swaps getPageWidth() / setPageWidth(double) and getPageHeight() / setPageHeight(double).
value - The orientation of the page. The value must be one of Orientation constants.public double getLeftMargin()
public void setLeftMargin(double value)
value - The distance (in points) between the left edge of the page and the left boundary of the body text.public double getRightMargin()
public void setRightMargin(double value)
value - The distance (in points) between the right edge of the page and the right boundary of the body text.public double getTopMargin()
public void setTopMargin(double value)
value - The distance (in points) between the top edge of the page and the top boundary of the body text.public double getBottomMargin()
public void setBottomMargin(double value)
value - The distance (in points) between the bottom edge of the page and the bottom boundary of the body text.public double getHeaderDistance()
public void setHeaderDistance(double value)
value - The distance (in points) between the header and the top of the page.public double getFooterDistance()
public void setFooterDistance(double value)
value - The distance (in points) between the footer and the bottom of the page.public double getGutter()
public void setGutter(double value)
value - The amount of extra space added to the margin for document binding.public int getFirstPageTray()
public void setFirstPageTray(int value)
value - The paper tray (bin) to use for the first page of a section.public int getOtherPagesTray()
public void setOtherPagesTray(int value)
value - The paper tray (bin) to be used for all but the first page of a section.public int getHeadingLevelForChapter()
Can be a number from 0 through 9. 0 means no chapter number if applied to page number.
Before you can create page numbers that include chapter numbers, the document headings must have a numbered outline format applied.
public void setHeadingLevelForChapter(int value)
Can be a number from 0 through 9. 0 means no chapter number if applied to page number.
Before you can create page numbers that include chapter numbers, the document headings must have a numbered outline format applied.
value - The heading level style that is applied to the chapter titles in the document.public int getChapterPageSeparator()
Before you can create page numbers that include chapter numbers, the document headings must have a numbered outline format applied.
ChapterPageSeparator constants.public void setChapterPageSeparator(int value)
Before you can create page numbers that include chapter numbers, the document headings must have a numbered outline format applied.
value - The separator character that appears between the chapter number and the page number. The value must be one of ChapterPageSeparator constants.public int getPageNumberStyle()
NumberStyle constants.public void setPageNumberStyle(int value)
value - The page number format. The value must be one of NumberStyle constants.public boolean getRestartPageNumbering()
getPageStartingNumber() / setPageStartingNumber(int) property so that page numbering can continue from the previous section.boolean value.public void setRestartPageNumbering(boolean value)
getPageStartingNumber() / setPageStartingNumber(int) property so that page numbering can continue from the previous section.value - The corresponding boolean value.public int getPageStartingNumber()
getRestartPageNumbering() / setRestartPageNumbering(boolean) property, if set to false, will override the PageStartingNumber property so that page numbering can continue from the previous section.public void setPageStartingNumber(int value)
getRestartPageNumbering() / setRestartPageNumbering(boolean) property, if set to false, will override the PageStartingNumber property so that page numbering can continue from the previous section.value - The starting page number of the section.public int getLineNumberRestartMode()
LineNumberRestartMode constants.public void setLineNumberRestartMode(int value)
value - The way line numbering runs that is, whether it starts over at the beginning of a new page or section or runs continuously. The value must be one of LineNumberRestartMode constants.public int getLineNumberCountBy()
public void setLineNumberCountBy(int value)
value - The numeric increment for line numbers.public double getLineNumberDistanceFromText()
public void setLineNumberDistanceFromText(double value)
value - Distance between the right edge of line numbers and the left edge of the document.public int getLineStartingNumber()
public void setLineStartingNumber(int value)
value - The starting line number.public TextColumnCollection getTextColumns()
public boolean getRtlGutter()
public void setRtlGutter(boolean value)
value - Whether Microsoft Word uses gutters for the section based on a right-to-left language or a left-to-right language.public boolean getBorderAlwaysInFront()
boolean value.public void setBorderAlwaysInFront(boolean value)
value - The corresponding boolean value.public int getBorderDistanceFrom()
PageBorderDistanceFrom constants.public void setBorderDistanceFrom(int value)
value - A value that indicates whether the specified page border is measured from the edge of the page or from the text it surrounds. The value must be one of PageBorderDistanceFrom constants.public int getBorderAppliesTo()
int value. The returned value is one of PageBorderAppliesTo constants.public void setBorderAppliesTo(int value)
value - The corresponding int value. The value must be one of PageBorderAppliesTo constants.public boolean getBorderSurroundsHeader()
boolean value.public void setBorderSurroundsHeader(boolean value)
value - The corresponding boolean value.public boolean getBorderSurroundsFooter()
boolean value.public void setBorderSurroundsFooter(boolean value)
value - The corresponding boolean value.public BorderCollection getBorders()
public FootnoteOptions getFootnoteOptions()
FootnoteOptions value.public EndnoteOptions getEndnoteOptions()
EndnoteOptions value.public int getTextOrientation()
getTextOrientation() / setTextOrientation(int) for the whole page. Default value is TextOrientation.HORIZONTAL
This property is only supported for MS Word native formats DOCX, WML, RTF and DOC.int value. The returned value is one of TextOrientation constants.public void setTextOrientation(int value)
getTextOrientation() / setTextOrientation(int) for the whole page. Default value is TextOrientation.HORIZONTAL
This property is only supported for MS Word native formats DOCX, WML, RTF and DOC.value - The corresponding int value. The value must be one of TextOrientation constants.public java.lang.Object getDirectBorderAttr(int key)
public java.lang.Object fetchInheritedBorderAttr(int key)
public void setBorderAttr(int key,
java.lang.Object value)