com.aspose.cells

Class PageSetup

  • java.lang.Object
    • com.aspose.cells.PageSetup
public 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
booleangetBlackAndWhite()
void
setBlackAndWhite(booleanvalue)
           Represents if elements of the document will be printed in black and white.
doublegetBottomMargin()
void
setBottomMargin(doublevalue)
           Represents the size of the bottom margin, in unit of centimeters.
doublegetBottomMarginInch()
void
setBottomMarginInch(doublevalue)
           Represents the size of the bottom margin, in unit of inches.
booleangetCenterHorizontally()
void
setCenterHorizontally(booleanvalue)
           Represent if the sheet is printed centered horizontally.
booleangetCenterVertically()
void
setCenterVertically(booleanvalue)
           Represent if the sheet is printed centered vertically.
intgetFirstPageNumber()
void
           Represents the first page number that will be used when this sheet is printed.
intgetFitToPagesTall()
void
           Represents the number of pages tall the worksheet will be scaled to when it's printed. The default value is 1.
intgetFitToPagesWide()
void
           Represents the number of pages wide the worksheet will be scaled to when it's printed. The default value is 1.
doublegetFooterMargin()
void
setFooterMargin(doublevalue)
           Represents the distance from the bottom of the page to the footer, in unit of centimeters.
doublegetFooterMarginInch()
void
setFooterMarginInch(doublevalue)
           Represents the distance from the bottom of the page to the footer, in unit of inches.
doublegetHeaderMargin()
void
setHeaderMargin(doublevalue)
           Represents the distance from the top of the page to the header, in unit of centimeters.
doublegetHeaderMarginInch()
void
setHeaderMarginInch(doublevalue)
           Represents the distance from the top of the page to the header, in unit of inches.
booleanisAutoFirstPageNumber()
void
           Indicates whether the first the page number is automatically assigned.
booleanisAutomaticPaperSize()
Indicates whether the paper size is automatic.
booleanisHFAlignMargins()
void
setHFAlignMargins(booleanvalue)
           Indicates whether header and footer margins are aligned with the page margins. If this property is true, the left header and footer will be aligned with the left margin, and the right header and footer will be aligned with the right margin. This option is enabled by default.
booleanisHFDiffFirst()
void
setHFDiffFirst(booleanvalue)
           True means that the header/footer of the first page is different with other pages.
booleanisHFDiffOddEven()
void
setHFDiffOddEven(booleanvalue)
           True means that the header/footer of the odd pages is different with odd pages.
booleanisHFScaleWithDoc()
void
setHFScaleWithDoc(booleanvalue)
           Indicates whether header and footer are scaled with document scaling. Only applies for Excel 2007.
booleanisPercentScale()
void
setPercentScale(booleanvalue)
           If this property is False, the FitToPagesWide and FitToPagesTall properties control how the worksheet is scaled.
doublegetLeftMargin()
void
setLeftMargin(doublevalue)
           Represents the size of the left margin, in unit of centimeters.
doublegetLeftMarginInch()
void
setLeftMarginInch(doublevalue)
           Represents the size of the left margin, in unit of inches.
OdsPageBackgroundgetODSPageBackground()
Gets the background of ODS.
intgetOrder()
void
setOrder(intvalue)
           Represents the order that Microsoft Excel uses to number pages when printing a large worksheet. The value of the property is PrintOrderType integer constant.
intgetOrientation()
void
setOrientation(intvalue)
           Represents page print orientation. The value of the property is PageOrientationType integer constant.
doublegetPaperHeight()
Represents the height in inches of the paper, considered page orientation.
intgetPaperSize()
void
setPaperSize(intvalue)
           Represents the size of the paper. The value of the property is PaperSizeType integer constant.
doublegetPaperWidth()
Represents the width in inches of the paper, considered page orientation.
java.lang.StringgetPrintArea()
void
setPrintArea(java.lang.Stringvalue)
           Represents the range to be printed.
intgetPrintComments()
void
           Represents the way comments are printed with the sheet. The value of the property is PrintCommentsType integer constant.
intgetPrintCopies()
void
setPrintCopies(intvalue)
           Get and sets number of copies to print.
booleangetPrintDraft()
void
setPrintDraft(booleanvalue)
           Represents if the sheet will be printed without graphics.
intgetPrintErrors()
void
setPrintErrors(intvalue)
           Specifies the type of print error displayed. The value of the property is PrintErrorsType integer constant.
byte[]getPrinterSettings()
void
setPrinterSettings(byte[]value)
           Gets and sets the settings of the default printer.
booleangetPrintGridlines()
void
setPrintGridlines(booleanvalue)
           Represents if cell gridlines are printed on the page.
booleangetPrintHeadings()
void
setPrintHeadings(booleanvalue)
           Represents if row and column headings are printed with this page.
intgetPrintQuality()
void
setPrintQuality(intvalue)
           Represents the print quality.
java.lang.StringgetPrintTitleColumns()
void
setPrintTitleColumns(java.lang.Stringvalue)
           Represents the columns that contain the cells to be repeated on the left side of each page.
java.lang.StringgetPrintTitleRows()
void
setPrintTitleRows(java.lang.Stringvalue)
           Represents the rows that contain the cells to be repeated at the top of each page.
doublegetRightMargin()
void
setRightMargin(doublevalue)
           Represents the size of the right margin, in unit of centimeters.
doublegetRightMarginInch()
void
setRightMarginInch(doublevalue)
           Represents the size of the right margin, in unit of inches.
doublegetTopMargin()
void
setTopMargin(doublevalue)
           Represents the size of the top margin, in unit of centimeters.
doublegetTopMarginInch()
void
setTopMarginInch(doublevalue)
           Represents the size of the top margin, in unit of inches.
intgetZoom()
void
setZoom(intvalue)
           Represents the scaling factor in percent. It should be between 10 and 400.
 
Method Summary
voidclearHeaderFooter()
Clears header and footer setting.
voidcopy(PageSetup source, CopyOptions copyOptions)
Copys the setting of the page setup.
voidcustomPaperSize(double width, double height)
Sets the custom paper size, in unit of inches.
com.aspose.cells.HeaderFooterCommand[]getCommands(java.lang.String headerFooterScript)
Gets all commands of header or footer.
java.lang.StringgetEvenFooter(int section)
Gets a script formatting the even footer of an Excel file.
java.lang.StringgetEvenHeader(int section)
Gets a script formatting the even header of an Excel file.
java.lang.StringgetFirstPageFooter(int section)
Gets a script formatting the first page footer of an Excel file.
java.lang.StringgetFirstPageHeader(int section)
Gets a script formatting the first page header of an Excel file.
java.lang.StringgetFooter(int section)
Gets a script formatting the footer of an Excel file.
java.lang.StringgetHeader(int section)
Gets a script formatting the header of an Excel file.
PicturegetPicture(boolean isFirst, boolean isEven, boolean isHeader, int section)
Gets the Picture object of the header / footer.
PicturegetPicture(boolean isHeader, int section)
Gets the Picture object of the header / footer.
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.
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.
voidsetFirstPageFooter(int section, java.lang.String footerScript)
Sets a script formatting the first page footer of an Excel file.
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.
voidsetFitToPages(int wide, int tall)
Sets the number of pages the worksheet will be scaled to when it's printed.
voidsetFooter(int section, java.lang.String footerScript)
Sets a script formatting the footer of an Excel file.
PicturesetFooterPicture(int section, byte[] footerPicture)
Sets an image in the footer of a worksheet.
voidsetHeader(int section, java.lang.String headerScript)
Sets a script formatting the header of an Excel file.
PicturesetHeaderPicture(int section, byte[] headerPicture)
Sets an image in the header of a worksheet.
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

      • getODSPageBackground

        public OdsPageBackground getODSPageBackground()
        
        Gets the background of ODS.
      • getPrintArea/setPrintArea

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

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

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

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

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

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

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

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

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

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

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

        public byte[] getPrinterSettings() / public void setPrinterSettings(byte[] value)
        
        Gets and sets the settings of the default printer.
      • getLeftMargin/setLeftMargin

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

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

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

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

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

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

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

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

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

        public int getFitToPagesTall() / public void setFitToPagesTall(int value)
        
        Represents the number of pages tall the worksheet will be scaled to when it's printed. The default value is 1. You have to set FitToPagesWide as zero if you want to fit all rows on one page.
      • getFitToPagesWide/setFitToPagesWide

        public int getFitToPagesWide() / public void setFitToPagesWide(int value)
        
        Represents the number of pages wide the worksheet will be scaled to when it's printed. The default value is 1. You have to set FitToPagesTall as zero if you want to fit all columns on one page.
      • isPercentScale/setPercentScale

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

        public int getOrder() / public 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.
      • isAutomaticPaperSize

        public boolean isAutomaticPaperSize()
        
        Indicates whether the paper size is automatic.
      • getPaperSize/setPaperSize

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

        public double getPaperWidth()
        
        Represents the width in inches of the paper, considered page orientation.
      • getPaperHeight

        public double getPaperHeight()
        
        Represents the height in inches of the paper, considered page orientation.
      • getOrientation/setOrientation

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

        public int getPrintComments() / public 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 int getPrintErrors() / public void setPrintErrors(int value)
        
        Specifies the type of print error displayed. The value of the property is PrintErrorsType integer constant.
      • getPrintHeadings/setPrintHeadings

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

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

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

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

        public int getPrintQuality() / public void setPrintQuality(int value)
        
        Represents the print quality.
      • getPrintCopies/setPrintCopies

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

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

        public boolean isHFDiffFirst() / public void setHFDiffFirst(boolean value)
        
        True means that the header/footer of the first page is different with other pages.
      • isHFScaleWithDoc/setHFScaleWithDoc

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

        public boolean isHFAlignMargins() / public void setHFAlignMargins(boolean value)
        
        Indicates whether header and footer margins are aligned with the page margins. If this property is true, the left header and footer will be aligned with the left margin, and the right header and footer will be aligned with the right margin. This option is enabled by default.

    setPrintArea

    public voidsetPrintArea(java.lang.Stringvalue)
    
    Represents the range to be printed.

    setPrintTitleColumns

    public voidsetPrintTitleColumns(java.lang.Stringvalue)
    
    Represents the columns that contain the cells to be repeated on the left side of each page.

    setPrintTitleRows

    public voidsetPrintTitleRows(java.lang.Stringvalue)
    
    Represents the rows that contain the cells to be repeated at the top of each page.

    setBlackAndWhite

    public voidsetBlackAndWhite(booleanvalue)
    
    Represents if elements of the document will be printed in black and white.

    setCenterHorizontally

    public voidsetCenterHorizontally(booleanvalue)
    
    Represent if the sheet is printed centered horizontally.

    setCenterVertically

    public voidsetCenterVertically(booleanvalue)
    
    Represent if the sheet is printed centered vertically.

    setPrintDraft

    public voidsetPrintDraft(booleanvalue)
    
    Represents if the sheet will be printed without graphics.

    setFooterMargin

    public voidsetFooterMargin(doublevalue)
    
    Represents the distance from the bottom of the page to the footer, in unit of centimeters.

    setFooterMarginInch

    public voidsetFooterMarginInch(doublevalue)
    
    Represents the distance from the bottom of the page to the footer, in unit of inches.

    setHeaderMargin

    public voidsetHeaderMargin(doublevalue)
    
    Represents the distance from the top of the page to the header, in unit of centimeters.

    setHeaderMarginInch

    public voidsetHeaderMarginInch(doublevalue)
    
    Represents the distance from the top of the page to the header, in unit of inches.

    setPrinterSettings

    public voidsetPrinterSettings(byte[]value)
    
    Gets and sets the settings of the default printer.

    setLeftMargin

    public voidsetLeftMargin(doublevalue)
    
    Represents the size of the left margin, in unit of centimeters.

    setLeftMarginInch

    public voidsetLeftMarginInch(doublevalue)
    
    Represents the size of the left margin, in unit of inches.

    setRightMargin

    public voidsetRightMargin(doublevalue)
    
    Represents the size of the right margin, in unit of centimeters.

    setRightMarginInch

    public voidsetRightMarginInch(doublevalue)
    
    Represents the size of the right margin, in unit of inches.

    setTopMargin

    public voidsetTopMargin(doublevalue)
    
    Represents the size of the top margin, in unit of centimeters.

    setTopMarginInch

    public voidsetTopMarginInch(doublevalue)
    
    Represents the size of the top margin, in unit of inches.

    setBottomMargin

    public voidsetBottomMargin(doublevalue)
    
    Represents the size of the bottom margin, in unit of centimeters.

    setBottomMarginInch

    public voidsetBottomMarginInch(doublevalue)
    
    Represents the size of the bottom margin, in unit of inches.

    setFirstPageNumber

    public voidsetFirstPageNumber(intvalue)
    
    Represents the first page number that will be used when this sheet is printed.

    setFitToPagesTall

    public voidsetFitToPagesTall(intvalue)
    
    Represents the number of pages tall the worksheet will be scaled to when it's printed. The default value is 1. You have to set FitToPagesWide as zero if you want to fit all rows on one page.

    setFitToPagesWide

    public voidsetFitToPagesWide(intvalue)
    
    Represents the number of pages wide the worksheet will be scaled to when it's printed. The default value is 1. You have to set FitToPagesTall as zero if you want to fit all columns on one page.

    setPercentScale

    public voidsetPercentScale(booleanvalue)
    
    If this property is False, the FitToPagesWide and FitToPagesTall properties control how the worksheet is scaled.

    setOrder

    public voidsetOrder(intvalue)
    
    Represents the order that Microsoft Excel uses to number pages when printing a large worksheet. The value of the property is PrintOrderType integer constant.

    setPaperSize

    public voidsetPaperSize(intvalue)
    
    Represents the size of the paper. The value of the property is PaperSizeType integer constant.

    setOrientation

    public voidsetOrientation(intvalue)
    
    Represents page print orientation. The value of the property is PageOrientationType integer constant.

    setPrintComments

    public voidsetPrintComments(intvalue)
    
    Represents the way comments are printed with the sheet. The value of the property is PrintCommentsType integer constant.

    setPrintErrors

    public voidsetPrintErrors(intvalue)
    
    Specifies the type of print error displayed. The value of the property is PrintErrorsType integer constant.

    setPrintHeadings

    public voidsetPrintHeadings(booleanvalue)
    
    Represents if row and column headings are printed with this page.

    setPrintGridlines

    public voidsetPrintGridlines(booleanvalue)
    
    Represents if cell gridlines are printed on the page.

    setZoom

    public voidsetZoom(intvalue)
    
    Represents the scaling factor in percent. It should be between 10 and 400.

    setAutoFirstPageNumber

    public voidsetAutoFirstPageNumber(booleanvalue)
    
    Indicates whether the first the page number is automatically assigned.

    setPrintQuality

    public voidsetPrintQuality(intvalue)
    
    Represents the print quality.

    setPrintCopies

    public voidsetPrintCopies(intvalue)
    
    Get and sets number of copies to print.

    setHFDiffOddEven

    public voidsetHFDiffOddEven(booleanvalue)
    
    True means that the header/footer of the odd pages is different with odd pages.

    setHFDiffFirst

    public voidsetHFDiffFirst(booleanvalue)
    
    True means that the header/footer of the first page is different with other pages.

    setHFScaleWithDoc

    public voidsetHFScaleWithDoc(booleanvalue)
    
    Indicates whether header and footer are scaled with document scaling. Only applies for Excel 2007.

    setHFAlignMargins

    public voidsetHFAlignMargins(booleanvalue)
    
    Indicates whether header and footer margins are aligned with the page margins. If this property is true, the left header and footer will be aligned with the left margin, and the right header and footer will be aligned with the right margin. This option is enabled by default.
    • Method Detail

      • setHeaderPicture

        public 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 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 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 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 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.
      • copy

        public void copy(PageSetup source, CopyOptions copyOptions)
                 throws java.lang.Exception
        Copys the setting of the page setup.
        Parameters:
        source - The source.
        copyOptions - The copy options.
      • setFitToPages

        public void setFitToPages(int wide, int tall)
        Sets the number of pages the worksheet will be scaled to when it's printed.
        Parameters:
        wide - Pages wide.
        tall - Pages tall.
      • customPaperSize

        public void customPaperSize(double width, double height)
        Sets the custom paper size, in unit of inches.
        Parameters:
        width - The width of the paper.
        height - The height of the paper.
      • clearHeaderFooter

        public void clearHeaderFooter()
        Clears header and footer setting.
      • getHeader

        public 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 com.aspose.cells.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 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 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 void setFooter(int section, java.lang.String footerScript)
        Sets a script formatting the footer of an Excel file. dddd

        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 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 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 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 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 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 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 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 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