com.aspose.cells
Class PageSetup

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

public abstract class PageSetup 
extends java.lang.Object

Encapsulates the object that represents the page setup description. The PageSetup object contains all page setup options.

Example:

sheet.getPageSetup().setPrintArea("D1:K13");
sheet.getPageSetup().setPrintTitleRows("$5:$7");
sheet.getPageSetup().setPrintTitleColumns("$A:$B");

Property Getters/Setters Summary
abstract booleangetBlackAndWhite()
abstract voidsetBlackAndWhite(boolean value)
           Represents if elements of the document will be printed in black and white.
abstract doublegetBottomMargin()
abstract voidsetBottomMargin(double value)
           Represents the size of the bottom margin, in unit of centimeters.
abstract doublegetBottomMarginInch()
abstract voidsetBottomMarginInch(double value)
           Represents the size of the bottom margin, in unit of inches.
abstract booleangetCenterHorizontally()
abstract voidsetCenterHorizontally(boolean value)
           Represent if the sheet is printed centered horizontally.
abstract booleangetCenterVertically()
abstract voidsetCenterVertically(boolean value)
           Represent if the sheet is printed centered vertically.
abstract intgetFirstPageNumber()
abstract voidsetFirstPageNumber(int value)
           Represents the first page number that will be used when this sheet is printed.
abstract intgetFitToPagesTall()
abstract voidsetFitToPagesTall(int value)
           Represents the number of pages tall the worksheet will be scaled to when it's printed.
abstract intgetFitToPagesWide()
abstract voidsetFitToPagesWide(int value)
           Represents the number of pages wide the worksheet will be scaled to when it's printed.
abstract doublegetFooterMargin()
abstract voidsetFooterMargin(double value)
           Represents the distance from the bottom of the page to the footer, in unit of centimeters.
abstract doublegetFooterMarginInch()
abstract voidsetFooterMarginInch(double value)
           Represents the distance from the bottom of the page to the footer, in unit of inches.
abstract doublegetHeaderMargin()
abstract voidsetHeaderMargin(double value)
           Represents the distance from the top of the page to the header, in unit of centimeters.
abstract doublegetHeaderMarginInch()
abstract voidsetHeaderMarginInch(double value)
           Represents the distance from the top of the page to the header, in unit of inches.
abstract booleanisAutoFirstPageNumber()
abstract voidsetAutoFirstPageNumber(boolean value)
           Indicates whether the first the page number is automatically assigned.
abstract booleanisHFAlignMargins()
abstract voidsetHFAlignMargins(boolean value)
           Indicates whether header and footer margins are aligned with the page margins. Only applies for Excel 2007.
abstract booleanisHFDiffFirst()
abstract voidsetHFDiffFirst(boolean value)
          
abstract booleanisHFDiffOddEven()
abstract voidsetHFDiffOddEven(boolean value)
           True means that the header/footer of the odd pages is different with odd pages.
abstract booleanisHFScaleWithDoc()
abstract voidsetHFScaleWithDoc(boolean value)
           Indicates whether header and footer are scaled with document scaling. Only applies for Excel 2007.
abstract booleanisPercentScale()
abstract voidsetPercentScale(boolean value)
           If this property is False, the FitToPagesWide and FitToPagesTall properties control how the worksheet is scaled.
abstract doublegetLeftMargin()
abstract voidsetLeftMargin(double value)
           Represents the size of the left margin, in unit of centimeters.
abstract doublegetLeftMarginInch()
abstract voidsetLeftMarginInch(double value)
           Represents the size of the left margin, in unit of inches.
abstract intgetOrder()
abstract voidsetOrder(int value)
           Represents the order that Microsoft Excel uses to number pages when printing a large worksheet. The value of the property is PrintOrderType integer constant.
abstract intgetOrientation()
abstract voidsetOrientation(int value)
           Represents page print orientation. The value of the property is PageOrientationType integer constant.
abstract intgetPaperSize()
abstract voidsetPaperSize(int value)
           Represents the size of the paper. The value of the property is PaperSizeType integer constant.
abstract java.lang.StringgetPrintArea()
abstract voidsetPrintArea(java.lang.String value)
           Represents the range to be printed.
abstract intgetPrintComments()
abstract voidsetPrintComments(int value)
           Represents the way comments are printed with the sheet. The value of the property is PrintCommentsType integer constant.
abstract intgetPrintCopies()
abstract voidsetPrintCopies(int value)
           Get and sets number of copies to print.
abstract booleangetPrintDraft()
abstract voidsetPrintDraft(boolean value)
           Represents if the sheet will be printed without graphics.
abstract intgetPrintErrors()
abstract voidsetPrintErrors(int value)
           Specifies the type of print error displayed. The value of the property is PrintErrorsType integer constant.
abstract booleangetPrintGridlines()
abstract voidsetPrintGridlines(boolean value)
           Represents if cell gridlines are printed on the page.
abstract booleangetPrintHeadings()
abstract voidsetPrintHeadings(boolean value)
           Represents if row and column headings are printed with this page.
abstract intgetPrintQuality()
abstract voidsetPrintQuality(int value)
           Represents the print quality.
abstract java.lang.StringgetPrintTitleColumns()
abstract voidsetPrintTitleColumns(java.lang.String value)
           Represents the columns that contain the cells to be repeated on the left side of each page.
abstract java.lang.StringgetPrintTitleRows()
abstract voidsetPrintTitleRows(java.lang.String value)
           Represents the rows that contain the cells to be repeated at the top of each page.
abstract doublegetRightMargin()
abstract voidsetRightMargin(double value)
           Represents the size of the right margin, in unit of centimeters.
abstract doublegetRightMarginInch()
abstract voidsetRightMarginInch(double value)
           Represents the size of the right margin, in unit of inches.
abstract doublegetTopMargin()
abstract voidsetTopMargin(double value)
           Represents the size of the top margin, in unit of centimeters.
abstract doublegetTopMarginInch()
abstract voidsetTopMarginInch(double value)
           Represents the size of the top margin, in unit of inches.
abstract intgetZoom()
abstract voidsetZoom(int value)
           Represents the scaling factor in percent. It should be between 10 and 400.
 
Method Summary
abstract voidclearHeaderFooter()
           Clears header and footer setting.
abstract HeaderFooterCommand[]getCommands(java.lang.String headerFooterScript)
           Gets all commands of header or footer.
abstract java.lang.StringgetEvenFooter(int section)
           Gets a script formatting the even footer of an Excel file.
abstract java.lang.StringgetEvenHeader(int section)
           Gets a script formatting the even header of an Excel file.
abstract java.lang.StringgetFirstPageFooter(int section)
           Gets a script formatting the first page footer of an Excel file.
abstract java.lang.StringgetFirstPageHeader(int section)
           Gets a script formatting the first page header of an Excel file.
abstract java.lang.StringgetFooter(int section)
           Gets a script formatting the footer of an Excel file.
abstract java.lang.StringgetHeader(int section)
           Gets a script formatting the header of an Excel file.
abstract PicturegetPicture(boolean isFirst, boolean isEven, boolean isHeader, int section)
           Gets the Picture object of the header / footer.
abstract PicturegetPicture(boolean isHeader, int section)
           Gets the Picture object of the header / footer.
abstract voidsetEvenFooter(int section, java.lang.String footerScript)
           Sets a script formatting the even page footer of an Excel file. Only effect in Excel 2007 when IsHFDiffOddEven is true.
abstract voidsetEvenHeader(int section, java.lang.String headerScript)
           Sets a script formatting the even page header of an Excel file. Only effect in Excel 2007 when IsHFDiffOddEven is true.
abstract voidsetFirstPageFooter(int section, java.lang.String footerScript)
           Sets a script formatting the first page footer of an Excel file.
abstract voidsetFirstPageHeader(int section, java.lang.String headerScript)
           Sets a script formatting the first page header of an Excel file. Only effect in Excel 2007 when IsHFDiffFirst is true.
abstract voidsetFooter(int section, java.lang.String footerScript)
           Sets a script formatting the footer of an Excel file.
abstract PicturesetFooterPicture(int section, byte[] footerPicture)
           Sets an image in the footer of a worksheet.
abstract voidsetHeader(int section, java.lang.String headerScript)
           Sets a script formatting the header of an Excel file.
abstract PicturesetHeaderPicture(int section, byte[] headerPicture)
           Sets an image in the header of a worksheet.
abstract PicturesetPicture(boolean isFirst, boolean isEven, boolean isHeader, int section, byte[] imageData)
           Sets an image in the header/footer of a worksheet.
 

Property Getters/Setters Detail

getPrintArea/setPrintArea

public abstract java.lang.String getPrintArea() / public abstract void setPrintArea(java.lang.String value)
Represents the range to be printed.

getPrintTitleColumns/setPrintTitleColumns

public abstract java.lang.String getPrintTitleColumns() / public abstract void setPrintTitleColumns(java.lang.String value)
Represents the columns that contain the cells to be repeated on the left side of each page.

Example:

cells.getPageSetup().setPrintTitleColumns("$A:$A");

getPrintTitleRows/setPrintTitleRows

public abstract java.lang.String getPrintTitleRows() / public abstract void setPrintTitleRows(java.lang.String value)
Represents the rows that contain the cells to be repeated at the top of each page.

Example:

cells.getPageSetup().setPrintTitleRows("$1:$1");

getBlackAndWhite/setBlackAndWhite

public abstract boolean getBlackAndWhite() / public abstract void setBlackAndWhite(boolean value)
Represents if elements of the document will be printed in black and white.

getCenterHorizontally/setCenterHorizontally

public abstract boolean getCenterHorizontally() / public abstract void setCenterHorizontally(boolean value)
Represent if the sheet is printed centered horizontally.

getCenterVertically/setCenterVertically

public abstract boolean getCenterVertically() / public abstract void setCenterVertically(boolean value)
Represent if the sheet is printed centered vertically.

getPrintDraft/setPrintDraft

public abstract boolean getPrintDraft() / public abstract void setPrintDraft(boolean value)
Represents if the sheet will be printed without graphics.

getFooterMargin/setFooterMargin

public abstract double getFooterMargin() / public abstract void setFooterMargin(double value)
Represents the distance from the bottom of the page to the footer, in unit of centimeters.

getFooterMarginInch/setFooterMarginInch

public abstract double getFooterMarginInch() / public abstract void setFooterMarginInch(double value)
Represents the distance from the bottom of the page to the footer, in unit of inches.

getHeaderMargin/setHeaderMargin

public abstract double getHeaderMargin() / public abstract void setHeaderMargin(double value)
Represents the distance from the top of the page to the header, in unit of centimeters.

getHeaderMarginInch/setHeaderMarginInch

public abstract double getHeaderMarginInch() / public abstract void setHeaderMarginInch(double value)
Represents the distance from the top of the page to the header, in unit of inches.

getLeftMargin/setLeftMargin

public abstract double getLeftMargin() / public abstract void setLeftMargin(double value)
Represents the size of the left margin, in unit of centimeters.

getLeftMarginInch/setLeftMarginInch

public abstract double getLeftMarginInch() / public abstract void setLeftMarginInch(double value)
Represents the size of the left margin, in unit of inches.

getRightMargin/setRightMargin

public abstract double getRightMargin() / public abstract void setRightMargin(double value)
Represents the size of the right margin, in unit of centimeters.

getRightMarginInch/setRightMarginInch

public abstract double getRightMarginInch() / public abstract void setRightMarginInch(double value)
Represents the size of the right margin, in unit of inches.

getTopMargin/setTopMargin

public abstract double getTopMargin() / public abstract void setTopMargin(double value)
Represents the size of the top margin, in unit of centimeters.

getTopMarginInch/setTopMarginInch

public abstract double getTopMarginInch() / public abstract void setTopMarginInch(double value)
Represents the size of the top margin, in unit of inches.

getBottomMargin/setBottomMargin

public abstract double getBottomMargin() / public abstract void setBottomMargin(double value)
Represents the size of the bottom margin, in unit of centimeters.

getBottomMarginInch/setBottomMarginInch

public abstract double getBottomMarginInch() / public abstract void setBottomMarginInch(double value)
Represents the size of the bottom margin, in unit of inches.

getFirstPageNumber/setFirstPageNumber

public abstract int getFirstPageNumber() / public abstract void setFirstPageNumber(int value)
Represents the first page number that will be used when this sheet is printed.

getFitToPagesTall/setFitToPagesTall

public abstract int getFitToPagesTall() / public abstract void setFitToPagesTall(int value)
Represents the number of pages tall the worksheet will be scaled to when it's printed.

getFitToPagesWide/setFitToPagesWide

public abstract int getFitToPagesWide() / public abstract void setFitToPagesWide(int value)
Represents the number of pages wide the worksheet will be scaled to when it's printed.

isPercentScale/setPercentScale

public abstract boolean isPercentScale() / public abstract void setPercentScale(boolean value)
If this property is False, the FitToPagesWide and FitToPagesTall properties control how the worksheet is scaled.

getOrder/setOrder

public abstract int getOrder() / public abstract void setOrder(int value)
Represents the order that Microsoft Excel uses to number pages when printing a large worksheet. The value of the property is PrintOrderType integer constant.

getPaperSize/setPaperSize

public abstract int getPaperSize() / public abstract void setPaperSize(int value)
Represents the size of the paper. The value of the property is PaperSizeType integer constant.

getOrientation/setOrientation

public abstract int getOrientation() / public abstract void setOrientation(int value)
Represents page print orientation. The value of the property is PageOrientationType integer constant.

getPrintComments/setPrintComments

public abstract int getPrintComments() / public abstract void setPrintComments(int value)
Represents the way comments are printed with the sheet. The value of the property is PrintCommentsType integer constant.

getPrintErrors/setPrintErrors

public abstract int getPrintErrors() / public abstract void setPrintErrors(int value)
Specifies the type of print error displayed. The value of the property is PrintErrorsType integer constant.

getPrintHeadings/setPrintHeadings

public abstract boolean getPrintHeadings() / public abstract void setPrintHeadings(boolean value)
Represents if row and column headings are printed with this page.

getPrintGridlines/setPrintGridlines

public abstract boolean getPrintGridlines() / public abstract void setPrintGridlines(boolean value)
Represents if cell gridlines are printed on the page.

getZoom/setZoom

public abstract int getZoom() / public abstract void setZoom(int value)
Represents the scaling factor in percent. It should be between 10 and 400.

isAutoFirstPageNumber/setAutoFirstPageNumber

public abstract boolean isAutoFirstPageNumber() / public abstract void setAutoFirstPageNumber(boolean value)
Indicates whether the first the page number is automatically assigned.

getPrintQuality/setPrintQuality

public abstract int getPrintQuality() / public abstract void setPrintQuality(int value)
Represents the print quality.

getPrintCopies/setPrintCopies

public abstract int getPrintCopies() / public abstract void setPrintCopies(int value)
Get and sets number of copies to print.

isHFDiffOddEven/setHFDiffOddEven

public abstract boolean isHFDiffOddEven() / public abstract void setHFDiffOddEven(boolean value)
True means that the header/footer of the odd pages is different with odd pages.

isHFDiffFirst/setHFDiffFirst

public abstract boolean isHFDiffFirst() / public abstract void setHFDiffFirst(boolean value)

isHFScaleWithDoc/setHFScaleWithDoc

public abstract boolean isHFScaleWithDoc() / public abstract void setHFScaleWithDoc(boolean value)
Indicates whether header and footer are scaled with document scaling. Only applies for Excel 2007.

isHFAlignMargins/setHFAlignMargins

public abstract boolean isHFAlignMargins() / public abstract void setHFAlignMargins(boolean value)
Indicates whether header and footer margins are aligned with the page margins. Only applies for Excel 2007.

Method Detail

clearHeaderFooter

public abstract void clearHeaderFooter()
Clears header and footer setting.

getHeader

public abstract java.lang.String getHeader(int section)
Gets a script formatting the header of an Excel file.
Parameters:
section -

0:Left Section.

1:Center Section

2:Right Section


getCommands

public abstract HeaderFooterCommand[] getCommands(java.lang.String headerFooterScript)
Gets all commands of header or footer.
Parameters:
headerFooterScript - The header/footer script
Returns:
Returns all commands of header or footer.

getFooter

public abstract java.lang.String getFooter(int section)
Gets a script formatting the footer of an Excel file.
Parameters:
section -

0:Left Section.

1:Center Section

2:Right Section


setHeader

public abstract void setHeader(int section, java.lang.String headerScript)
Sets a script formatting the header of an Excel file.

Script commands:

Command¡¡Description¡¡
&PCurrent page number¡¡
&NPage count¡¡
&DCurrent date¡¡
&TCurrent time
&ASheet name
&FFile name without path
&"<FontName>"Font name, for exampe: &"Arial"
&"<FontName>, <FontStyle>"Font name and font style, for exampe: &"Arial,Bold"
&<FontSize>Font size. If this command is followed by a plain number to be printed in the header, it will be separated from the font height with a space character.
&"<K"Font color, for exampe(RED): &FF0000
&GImage script
For example: "&Arial,Bold&8Header Note"
Parameters:
section -

0:Left Section.

1:Center Section

2:Right Section

headerScript - Header format script.

setFooter

public abstract void setFooter(int section, java.lang.String footerScript)
Sets a script formatting the footer of an Excel file.

Script commands:

Command¡¡Description¡¡
&PCurrent page number¡¡
&NPage count¡¡
&DCurrent date¡¡
&TCurrent time
&ASheet name
&FFile name without path
&"<FontName>"Font name, for exampe: &"Arial"
&"<FontName>, <FontStyle>"Font name and font style, for exampe: &"Arial,Bold"
&<FontSize>Font size. If this command is followed by a plain number to be printed in the header, it will be separated from the font height with a space character.
&GImage script
For example: "&Arial,Bold&8Footer Note"
Parameters:
section -

0:Left Section.

1:Center Section

2:Right Section

footerScript - Footer format script.

setEvenHeader

public abstract void setEvenHeader(int section, java.lang.String headerScript)
Sets a script formatting the even page header of an Excel file. Only effect in Excel 2007 when IsHFDiffOddEven is true.
Parameters:
section -

0:Left Section.

1:Center Section

2:Right Section

headerScript - Header format script.

getEvenHeader

public abstract java.lang.String getEvenHeader(int section)
Gets a script formatting the even header of an Excel file.
Parameters:
section -

0:Left Section.

1:Center Section

2:Right Section


setEvenFooter

public abstract void setEvenFooter(int section, java.lang.String footerScript)
Sets a script formatting the even page footer of an Excel file. Only effect in Excel 2007 when IsHFDiffOddEven is true.
Parameters:
section -

0:Left Section.

1:Center Section

2:Right Section

footerScript - Footer format script.

getEvenFooter

public abstract java.lang.String getEvenFooter(int section)
Gets a script formatting the even footer of an Excel file.
Parameters:
section -

0:Left Section.

1:Center Section

2:Right Section


setFirstPageHeader

public abstract void setFirstPageHeader(int section, java.lang.String headerScript)
Sets a script formatting the first page header of an Excel file. Only effect in Excel 2007 when IsHFDiffFirst is true.
Parameters:
section -

0:Left Section.

1:Center Section

2:Right Section

headerScript - Header format script.

getFirstPageHeader

public abstract java.lang.String getFirstPageHeader(int section)
Gets a script formatting the first page header of an Excel file.
Parameters:
section -

0:Left Section.

1:Center Section

2:Right Section


setFirstPageFooter

public abstract void setFirstPageFooter(int section, java.lang.String footerScript)
Sets a script formatting the first page footer of an Excel file.
Parameters:
section -

0:Left Section.

1:Center Section

2:Right Section

footerScript - Footer format script.

getFirstPageFooter

public abstract java.lang.String getFirstPageFooter(int section)
Gets a script formatting the first page footer of an Excel file.
Parameters:
section -

0:Left Section.

1:Center Section

2:Right Section


setHeaderPicture

public abstract Picture setHeaderPicture(int section, byte[] headerPicture)
Sets an image in the header of a worksheet.
Parameters:
section -

0:Left Section.

1:Center Section

2:Right Section

headerPicture - Image data.
Returns:
Returns Picture object.

setFooterPicture

public abstract Picture setFooterPicture(int section, byte[] footerPicture)
Sets an image in the footer of a worksheet.
Parameters:
section -

0:Left Section.

1:Center Section

2:Right Section

footerPicture - Image data.
Returns:
Returns Picture object.

setPicture

public abstract Picture setPicture(boolean isFirst, boolean isEven, boolean isHeader, int section, byte[] imageData)
Sets an image in the header/footer of a worksheet.
Parameters:
isFirst - Indicateds whether setting the picture of first page header/footer.
isEven - Indicateds whether setting the picture of even page header/footer.
isHeader - Indicateds whether setting the picture of header/footer.
section -

0:Left Section.

1:Center Section

2:Right Section

imageData - Image data.
Returns:
Returns Picture object.

getPicture

public abstract Picture getPicture(boolean isHeader, int section)
Gets the Picture object of the header / footer.
Parameters:
isHeader - Indicates whether it is in the header or footer.
section -

0:Left Section.

1:Center Section

2:Right Section

Returns:
Returns Picture object. Returns null if there is no picture.

getPicture

public abstract Picture getPicture(boolean isFirst, boolean isEven, boolean isHeader, int section)
Gets the Picture object of the header / footer.
Parameters:
isFirst - Indicateds whether getting the picture of first page header/footer.
isEven - Indicateds whether getting the picture of even page header/footer.
isHeader - Indicateds whether getting the picture of header/footer.
section -

0:Left Section.

1:Center Section

2:Right Section

Returns:
Returns Picture object.

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