com.aspose.words
Class PageSetup

java.lang.Object
    extended by com.aspose.words.PageSetup

public class PageSetup 
extends java.lang.Object

Represents the page setup properties of a section.

PageSetup object contains all the page setup attributes of a section (left margin, bottom margin, paper size, and so on) as properties.


Property Getters/Setters Summary
booleangetBidi()
voidsetBidi(boolean value)
           Specifies that this section contains bidirectional (complex scripts) text.
booleangetBorderAlwaysInFront()
voidsetBorderAlwaysInFront(boolean value)
           Specifies where the page border is positioned relative to intersecting texts and objects.
intgetBorderAppliesTo()
voidsetBorderAppliesTo(int value)
           Specifies which pages the page border is printed on. The value of the property is PageBorderAppliesTo integer constant.
intgetBorderDistanceFrom()
voidsetBorderDistanceFrom(int value)
           Gets or sets 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 of the property is PageBorderDistanceFrom integer constant.
BorderCollectiongetBorders()
           Gets a collection of the page borders.
booleangetBorderSurroundsFooter()
voidsetBorderSurroundsFooter(boolean value)
           Specifies whether the page border includes or excludes the footer.
booleangetBorderSurroundsHeader()
voidsetBorderSurroundsHeader(boolean value)
           Specifies whether the page border includes or excludes the header.
doublegetBottomMargin()
voidsetBottomMargin(double value)
           Returns or sets the distance (in points) between the bottom edge of the page and the bottom boundary of the body text.
intgetCharactersPerLine()
voidsetCharactersPerLine(int value)
           Gets or sets the number of characters per line in the document grid.
booleangetDifferentFirstPageHeaderFooter()
voidsetDifferentFirstPageHeaderFooter(boolean value)
          True if a different header or footer is used on the first page.
EndnoteOptionsgetEndnoteOptions()
           Provides options that control numbering and positioning of endnotes in this section.
intgetFirstPageTray()
voidsetFirstPageTray(int value)
           Gets or sets the paper tray (bin) to use for the first page of a section. The value is implementation (printer) specific.
doublegetFooterDistance()
voidsetFooterDistance(double value)
           Returns or sets the distance (in points) between the footer and the bottom of the page.
FootnoteOptionsgetFootnoteOptions()
           Provides options that control numbering and positioning of footnotes in this section.
doublegetGutter()
voidsetGutter(double value)
           Gets or sets the amount of extra space added to the margin for document binding.
doublegetHeaderDistance()
voidsetHeaderDistance(double value)
           Returns or sets the distance (in points) between the header and the top of the page.
intgetLayoutMode()
voidsetLayoutMode(int value)
           Gets or sets the layout mode of this section. The value of the property is SectionLayoutMode integer constant.
doublegetLeftMargin()
voidsetLeftMargin(double value)
           Returns or sets the distance (in points) between the left edge of the page and the left boundary of the body text.
intgetLineNumberCountBy()
voidsetLineNumberCountBy(int value)
           Returns or sets the numeric increment for line numbers.
doublegetLineNumberDistanceFromText()
voidsetLineNumberDistanceFromText(double value)
           Gets or sets distance between the right edge of line numbers and the left edge of the document.
intgetLineNumberRestartMode()
voidsetLineNumberRestartMode(int value)
           Gets or sets 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 of the property is LineNumberRestartMode integer constant.
intgetLinesPerPage()
voidsetLinesPerPage(int value)
           Gets or sets the number of lines per page in the document grid.
intgetLineStartingNumber()
voidsetLineStartingNumber(int value)
           Gets or sets the starting line number.
booleangetMirrorMargins()
voidsetMirrorMargins(boolean value)
           For multiple page documents, swaps left and right margins on facing pages.
Aspose.Words.Settings.MultiplePagesTypegetMultiplePages()
           For multiple page documents, gets or sets how a document is printed or rendered so that it can be bound as a booklet.
booleangetOddAndEvenPagesHeaderFooter()
voidsetOddAndEvenPagesHeaderFooter(boolean value)
          True if the document has different headers and footers for odd-numbered and even-numbered pages.
intgetOrientation()
voidsetOrientation(int value)
           Returns or sets the orientation of the page. The value of the property is Orientation integer constant.
intgetOtherPagesTray()
voidsetOtherPagesTray(int value)
           Gets or sets the paper tray (bin) to be used for all but the first page of a section. The value is implementation (printer) specific.
doublegetPageHeight()
voidsetPageHeight(double value)
           Returns or sets the height of the page in points.
intgetPageNumberStyle()
voidsetPageNumberStyle(int value)
           Gets or sets the page number format. The value of the property is NumberStyle integer constant.
intgetPageStartingNumber()
voidsetPageStartingNumber(int value)
           Gets or sets the starting page number of the section.
doublegetPageWidth()
voidsetPageWidth(double value)
           Returns or sets the width of the page in points.
intgetPaperSize()
voidsetPaperSize(int value)
           Returns or sets the paper size. The value of the property is PaperSize integer constant.
booleangetRestartPageNumbering()
voidsetRestartPageNumbering(boolean value)
          True if page numbering restarts at the beginning of the section.
doublegetRightMargin()
voidsetRightMargin(double value)
           Returns or sets the distance (in points) between the right edge of the page and the right boundary of the body text.
booleangetRtlGutter()
voidsetRtlGutter(boolean value)
           Gets or sets whether Microsoft Word uses gutters for the section based on a right-to-left language or a left-to-right language.
intgetSectionStart()
voidsetSectionStart(int value)
           Returns or sets the type of section break for the specified object. The value of the property is SectionStart integer constant.
intgetSheetsPerBooklet()
voidsetSheetsPerBooklet(int value)
           Returns or sets the number of pages to be included in each booklet.
booleangetSuppressEndnotes()
voidsetSuppressEndnotes(boolean value)
          True if endnotes are printed at the end of the next section that doesn't suppress endnotes. Suppressed endnotes are printed before the endnotes in that section.
TextColumnCollectiongetTextColumns()
           Returns a collection that represents the set of text columns.
intgetTextOrientation()
voidsetTextOrientation(int value)
           Allows to specify TextOrientation for the whole page. Default value is TextOrientation.HORIZONTALThe value of the property is TextOrientation integer constant.
doublegetTopMargin()
voidsetTopMargin(double value)
           Returns or sets the distance (in points) between the top edge of the page and the top boundary of the body text.
intgetVerticalAlignment()
voidsetVerticalAlignment(int value)
           Returns or sets the vertical alignment of text on each page in a document or section. The value of the property is PageVerticalAlignment integer constant.
 
Method Summary
voidclearFormatting()
           Resets page setup to default paper size, margins and orientation.
java.lang.ObjectfetchInheritedBorderAttr(int key)
          Reserved for internal use.
java.lang.ObjectgetDirectBorderAttr(int key)
          Reserved for internal use.
java.util.TreeMapgetPossibleBorderKeys()
          Reserved for internal use.
voidsetBorderAttr(int key, java.lang.Object value)
          Reserved for internal use.
 

Property Getters/Setters Detail

getBidi/setBidi

public boolean getBidi() / public void setBidi(boolean value)
Specifies that this section contains bidirectional (complex scripts) text.

When true, the columns in this section are laid out from right to left.


getBorderAlwaysInFront/setBorderAlwaysInFront

public boolean getBorderAlwaysInFront() / public void setBorderAlwaysInFront(boolean value)
Specifies where the page border is positioned relative to intersecting texts and objects.

getBorderAppliesTo/setBorderAppliesTo

public int getBorderAppliesTo() / public void setBorderAppliesTo(int value)
Specifies which pages the page border is printed on. The value of the property is PageBorderAppliesTo integer constant.

getBorderDistanceFrom/setBorderDistanceFrom

public int getBorderDistanceFrom() / public void setBorderDistanceFrom(int value)
Gets or sets 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 of the property is PageBorderDistanceFrom integer constant.

getBorders

public BorderCollection getBorders()
Gets a collection of the page borders.

getBorderSurroundsFooter/setBorderSurroundsFooter

public boolean getBorderSurroundsFooter() / public void setBorderSurroundsFooter(boolean value)
Specifies whether the page border includes or excludes the footer. Note, changing this property affects all sections in the document.

getBorderSurroundsHeader/setBorderSurroundsHeader

public boolean getBorderSurroundsHeader() / public void setBorderSurroundsHeader(boolean value)
Specifies whether the page border includes or excludes the header. Note, changing this property affects all sections in the document.

getBottomMargin/setBottomMargin

public double getBottomMargin() / public void setBottomMargin(double value)
Returns or sets the distance (in points) between the bottom edge of the page and the bottom boundary of the body text.

getCharactersPerLine/setCharactersPerLine

public int getCharactersPerLine() / public void setCharactersPerLine(int value)
Gets or sets the number of characters per line in the document grid.

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.


getDifferentFirstPageHeaderFooter/setDifferentFirstPageHeaderFooter

public boolean getDifferentFirstPageHeaderFooter() / public void setDifferentFirstPageHeaderFooter(boolean value)
True if a different header or footer is used on the first page.

getEndnoteOptions

public EndnoteOptions getEndnoteOptions()
Provides options that control numbering and positioning of endnotes in this section.

getFirstPageTray/setFirstPageTray

public int getFirstPageTray() / public void setFirstPageTray(int value)
Gets or sets the paper tray (bin) to use for the first page of a section. The value is implementation (printer) specific.

getFooterDistance/setFooterDistance

public double getFooterDistance() / public void setFooterDistance(double value)
Returns or sets the distance (in points) between the footer and the bottom of the page.

getFootnoteOptions

public FootnoteOptions getFootnoteOptions()
Provides options that control numbering and positioning of footnotes in this section.

getGutter/setGutter

public double getGutter() / public void setGutter(double value)
Gets or sets the amount of extra space added to the margin for document binding.

getHeaderDistance/setHeaderDistance

public double getHeaderDistance() / public void setHeaderDistance(double value)
Returns or sets the distance (in points) between the header and the top of the page.

getLayoutMode/setLayoutMode

public int getLayoutMode() / public void setLayoutMode(int value)
Gets or sets the layout mode of this section. The value of the property is SectionLayoutMode integer constant.

getLeftMargin/setLeftMargin

public double getLeftMargin() / public void setLeftMargin(double value)
Returns or sets the distance (in points) between the left edge of the page and the left boundary of the body text.

getLineNumberCountBy/setLineNumberCountBy

public int getLineNumberCountBy() / public void setLineNumberCountBy(int value)
Returns or sets the numeric increment for line numbers.

getLineNumberDistanceFromText/setLineNumberDistanceFromText

public double getLineNumberDistanceFromText() / public void setLineNumberDistanceFromText(double value)
Gets or sets distance between the right edge of line numbers and the left edge of the document. Set this property to zero for automatic distance between the line numbers and text of the document.

getLineNumberRestartMode/setLineNumberRestartMode

public int getLineNumberRestartMode() / public void setLineNumberRestartMode(int value)
Gets or sets 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 of the property is LineNumberRestartMode integer constant.

getLinesPerPage/setLinesPerPage

public int getLinesPerPage() / public void setLinesPerPage(int value)
Gets or sets the number of lines per page in the document grid.

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.


getLineStartingNumber/setLineStartingNumber

public int getLineStartingNumber() / public void setLineStartingNumber(int value)
Gets or sets the starting line number.

getMirrorMargins/setMirrorMargins

public boolean getMirrorMargins() / public void setMirrorMargins(boolean value)
For multiple page documents, swaps left and right margins on facing pages. Note, changing this property affects all sections in the document.

getMultiplePages

public Aspose.Words.Settings.MultiplePagesType getMultiplePages()
For multiple page documents, gets or sets how a document is printed or rendered so that it can be bound as a booklet.

getOddAndEvenPagesHeaderFooter/setOddAndEvenPagesHeaderFooter

public boolean getOddAndEvenPagesHeaderFooter() / public void setOddAndEvenPagesHeaderFooter(boolean value)
True if the document has different headers and footers for odd-numbered and even-numbered pages. Note, changing this property affects all sections in the document.

getOrientation/setOrientation

public int getOrientation() / public void setOrientation(int value)
Returns or sets the orientation of the page. The value of the property is Orientation integer constant.

Changing Orientation swaps PageWidth and PageHeight.


getOtherPagesTray/setOtherPagesTray

public int getOtherPagesTray() / public void setOtherPagesTray(int value)
Gets or sets the paper tray (bin) to be used for all but the first page of a section. The value is implementation (printer) specific.

getPageHeight/setPageHeight

public double getPageHeight() / public void setPageHeight(double value)
Returns or sets the height of the page in points.

getPageNumberStyle/setPageNumberStyle

public int getPageNumberStyle() / public void setPageNumberStyle(int value)
Gets or sets the page number format. The value of the property is NumberStyle integer constant.

getPageStartingNumber/setPageStartingNumber

public int getPageStartingNumber() / public void setPageStartingNumber(int value)
Gets or sets the starting page number of the section. The RestartPageNumbering property, if set to false, will override the PageStartingNumber property so that page numbering can continue from the previous section.

getPageWidth/setPageWidth

public double getPageWidth() / public void setPageWidth(double value)
Returns or sets the width of the page in points.

getPaperSize/setPaperSize

public int getPaperSize() / public void setPaperSize(int value)
Returns or sets the paper size. The value of the property is PaperSize integer constant.

Setting this property updates PageWidth and PageHeight values. Setting this value to PaperSize.CUSTOM does not change existing values.


getRestartPageNumbering/setRestartPageNumbering

public boolean getRestartPageNumbering() / public void setRestartPageNumbering(boolean value)
True if page numbering restarts at the beginning of the section. If set to false, the RestartPageNumbering property will override the PageStartingNumber property so that page numbering can continue from the previous section.

getRightMargin/setRightMargin

public double getRightMargin() / public void setRightMargin(double value)
Returns or sets the distance (in points) between the right edge of the page and the right boundary of the body text.

getRtlGutter/setRtlGutter

public boolean getRtlGutter() / public void setRtlGutter(boolean value)
Gets or sets whether Microsoft Word uses gutters for the section based on a right-to-left language or a left-to-right language.

getSectionStart/setSectionStart

public int getSectionStart() / public void setSectionStart(int value)
Returns or sets the type of section break for the specified object. The value of the property is SectionStart integer constant.

getSheetsPerBooklet/setSheetsPerBooklet

public int getSheetsPerBooklet() / public void setSheetsPerBooklet(int value)
Returns or sets the number of pages to be included in each booklet.

getSuppressEndnotes/setSuppressEndnotes

public boolean getSuppressEndnotes() / public void setSuppressEndnotes(boolean value)
True if endnotes are printed at the end of the next section that doesn't suppress endnotes. Suppressed endnotes are printed before the endnotes in that section.

getTextColumns

public TextColumnCollection getTextColumns()
Returns a collection that represents the set of text columns.

getTextOrientation/setTextOrientation

public int getTextOrientation() / public void setTextOrientation(int value)
Allows to specify TextOrientation for the whole page. Default value is TextOrientation.HORIZONTALThe value of the property is TextOrientation integer constant.This property is only supported for MS Word native formats DOCX, WML, RTF and DOC.

getTopMargin/setTopMargin

public double getTopMargin() / public void setTopMargin(double value)
Returns or sets the distance (in points) between the top edge of the page and the top boundary of the body text.

getVerticalAlignment/setVerticalAlignment

public int getVerticalAlignment() / public void setVerticalAlignment(int value)
Returns or sets the vertical alignment of text on each page in a document or section. The value of the property is PageVerticalAlignment integer constant.

Method Detail

clearFormatting

public void clearFormatting()
Resets page setup to default paper size, margins and orientation.

fetchInheritedBorderAttr

public java.lang.Object fetchInheritedBorderAttr(int key)
Reserved for internal use.

getDirectBorderAttr

public java.lang.Object getDirectBorderAttr(int key)
Reserved for internal use.

getPossibleBorderKeys

public java.util.TreeMap getPossibleBorderKeys()
Reserved for internal use.

setBorderAttr

public void setBorderAttr(int key, java.lang.Object value)
Reserved for internal use.

See Also:
          Aspose.Words Documentation - the home page for the Aspose.Words Product Documentation.
          Aspose.Words Support Forum - our preferred method of support.