java.lang.Objectcom.aspose.cells.PageSetup
public class PageSetup
Example:
sheet.getPageSetup().setPrintArea("D1:K13");
sheet.getPageSetup().setPrintTitleRows("$5:$7");
sheet.getPageSetup().setPrintTitleColumns("$A:$B");
Property Getters/Setters Summary | ||
---|---|---|
boolean | getBlackAndWhite() | |
void | setBlackAndWhite(boolean value) | |
Represents if elements of the document will be printed in black and white. | ||
double | getBottomMargin() | |
void | setBottomMargin(double value) | |
Represents the size of the bottom margin, in unit of centimeters. | ||
double | getBottomMarginInch() | |
void | setBottomMarginInch(double value) | |
Represents the size of the bottom margin, in unit of inches. | ||
boolean | getCenterHorizontally() | |
void | setCenterHorizontally(boolean value) | |
Represent if the sheet is printed centered horizontally. | ||
boolean | getCenterVertically() | |
void | setCenterVertically(boolean value) | |
Represent if the sheet is printed centered vertically. | ||
boolean | getDraft() | |
void | setDraft(boolean value) | |
Represents if the sheet will be printed without graphics. | ||
int | getFirstPageNumber() | |
void | setFirstPageNumber(int value) | |
Represents the first page number that will be used when this sheet is printed. | ||
int | getFitToPagesTall() | |
void | setFitToPagesTall(int value) | |
Represents the number of pages tall the worksheet will be scaled to when it's printed. | ||
int | getFitToPagesWide() | |
void | setFitToPagesWide(int value) | |
Represents the number of pages wide the worksheet will be scaled to when it's printed. | ||
double | getFooterMargin() | |
void | setFooterMargin(double value) | |
Represents the distance from the bottom of the page to the footer, in unit of centimeters. | ||
double | getFooterMarginInch() | |
void | setFooterMarginInch(double value) | |
Represents the distance from the bottom of the page to the footer, in unit of inches. | ||
double | getHeaderMargin() | |
void | setHeaderMargin(double value) | |
Represents the distance from the top of the page to the header, in unit of centimeters. | ||
double | getHeaderMarginInch() | |
void | setHeaderMarginInch(double value) | |
Represents the distance from the top of the page to the header, in unit of inches. | ||
boolean | isAutoFirstPageNumber() | |
void | setAutoFirstPageNumber(boolean value) | |
Indicates whether the first the page number is automatically assigned. | ||
boolean | isHFAlignMargins() | |
void | setHFAlignMargins(boolean value) | |
Indicates whether header and footer margins are aligned with the page margins. Only applies for Excel 2007. | ||
boolean | isHFDiffFirst() | |
void | setHFDiffFirst(boolean value) | |
True means that the header/footer of the first page is different with other pages. | ||
boolean | isHFDiffOddEven() | |
void | setHFDiffOddEven(boolean value) | |
True means that the header/footer of the odd pages is different with odd pages. | ||
boolean | isHFScaleWithDoc() | |
void | setHFScaleWithDoc(boolean value) | |
Indicates whether header and footer are scaled with document scaling. Only applies for Excel 2007. | ||
boolean | isPercentScale() | |
void | setPercentScale(boolean value) | |
If this property is False, the FitToPagesWide and FitToPagesTall properties control how the worksheet is scaled. | ||
double | getLeftMargin() | |
void | setLeftMargin(double value) | |
Represents the size of the left margin, in unit of centimeters. | ||
double | getLeftMarginInch() | |
void | setLeftMarginInch(double value) | |
Represents the size of the left margin, in unit of inches. | ||
int | getOrder() | |
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. | ||
int | getOrientation() | |
void | setOrientation(int value) | |
Represents page print orientation. The value of the property is PageOrientationType integer constant. | ||
int | getPaperSize() | |
void | setPaperSize(int value) | |
Represents the size of the paper. The value of the property is PaperSizeType integer constant. | ||
java.lang.String | getPrintArea() | |
void | setPrintArea(java.lang.String value) | |
Represents the range to be printed. | ||
int | getPrintComments() | |
void | setPrintComments(int value) | |
Represents the way comments are printed with the sheet. The value of the property is PrintCommentsType integer constant. | ||
int | getPrintCopies() | |
void | setPrintCopies(int value) | |
Get and sets number of copies to print. | ||
boolean | getPrintDraft() | |
void | setPrintDraft(boolean value) | |
Represents if the sheet will be printed without graphics. | ||
int | getPrintErrors() | |
void | setPrintErrors(int value) | |
Specifies the type of print error displayed. The value of the property is PrintErrorsType integer constant. | ||
boolean | getPrintGridlines() | |
void | setPrintGridlines(boolean value) | |
Represents if cell gridlines are printed on the page. | ||
boolean | getPrintHeadings() | |
void | setPrintHeadings(boolean value) | |
Represents if row and column headings are printed with this page. | ||
int | getPrintQuality() | |
void | setPrintQuality(int value) | |
Represents the print quality. | ||
java.lang.String | getPrintTitleColumns() | |
void | setPrintTitleColumns(java.lang.String value) | |
Represents the columns that contain the cells to be repeated on the left side of each page. | ||
java.lang.String | getPrintTitleRows() | |
void | setPrintTitleRows(java.lang.String value) | |
Represents the rows that contain the cells to be repeated at the top of each page. | ||
double | getRightMargin() | |
void | setRightMargin(double value) | |
Represents the size of the right margin, in unit of centimeters. | ||
double | getRightMarginInch() | |
void | setRightMarginInch(double value) | |
Represents the size of the right margin, in unit of inches. | ||
double | getTopMargin() | |
void | setTopMargin(double value) | |
Represents the size of the top margin, in unit of centimeters. | ||
double | getTopMarginInch() | |
void | setTopMarginInch(double value) | |
Represents the size of the top margin, in unit of inches. | ||
int | getZoom() | |
void | setZoom(int value) | |
Represents the scaling factor in percent. It should be between 10 and 400. |
Method Summary | ||
---|---|---|
void | clearHeaderFooter() | |
Clears header and footer setting. | ||
com.aspose.cells.HeaderFooterCommand[] | getCommands(java.lang.String headerFooterScript) | |
Gets all commands of header or footer. | ||
java.lang.String | getEvenFooter(int section) | |
Gets a script formatting the even footer of an Excel file. | ||
java.lang.String | getEvenHeader(int section) | |
Gets a script formatting the even header of an Excel file. | ||
java.lang.String | getFirstPageFooter(int section) | |
Gets a script formatting the first page footer of an Excel file. | ||
java.lang.String | getFirstPageHeader(int section) | |
Gets a script formatting the first page header of an Excel file. | ||
java.lang.String | getFooter(int section) | |
Gets a script formatting the footer of an Excel file. | ||
java.lang.String | getHeader(int section) | |
Gets a script formatting the header of an Excel file. | ||
Picture | getPicture(boolean isHeader, int section) | |
Gets the |
||
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. | ||
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. | ||
void | setFirstPageFooter(int section, java.lang.String footerScript) | |
Sets a script formatting the first page footer of an Excel file. | ||
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. | ||
void | setFooter(int section, java.lang.String footerScript) | |
Sets a script formatting the footer of an Excel file. | ||
Picture | setFooterPicture(int section, byte[] footerPicture) | |
Sets an image in the footer of a worksheet. | ||
void | setHeader(int section, java.lang.String headerScript) | |
Sets a script formatting the header of an Excel file. | ||
Picture | setHeaderPicture(int section, byte[] headerPicture) | |
Sets an image in the header of a worksheet. |
Property Getters/Setters Detail |
---|
getPrintTitleColumns/setPrintTitleColumns | |
public java.lang.String getPrintTitleColumns() / public void setPrintTitleColumns(java.lang.String value) |
Example:
cells.getPageSetup().setPrintTitleColumns("$A:$A");
getPrintTitleRows/setPrintTitleRows | |
public java.lang.String getPrintTitleRows() / public void setPrintTitleRows(java.lang.String value) |
Example:
cells.getPageSetup().setPrintTitleRows("$1:$1");
getBlackAndWhite/setBlackAndWhite | |
public boolean getBlackAndWhite() / public void setBlackAndWhite(boolean value) |
getCenterHorizontally/setCenterHorizontally | |
public boolean getCenterHorizontally() / public void setCenterHorizontally(boolean value) |
getCenterVertically/setCenterVertically | |
public boolean getCenterVertically() / public void setCenterVertically(boolean value) |
getDraft/setDraft | |
public boolean getDraft() / public void setDraft(boolean value) |
getPrintDraft/setPrintDraft | |
public boolean getPrintDraft() / public void setPrintDraft(boolean value) |
getFooterMargin/setFooterMargin | |
public double getFooterMargin() / public void setFooterMargin(double value) |
getFooterMarginInch/setFooterMarginInch | |
public double getFooterMarginInch() / public void setFooterMarginInch(double value) |
getHeaderMargin/setHeaderMargin | |
public double getHeaderMargin() / public void setHeaderMargin(double value) |
getHeaderMarginInch/setHeaderMarginInch | |
public double getHeaderMarginInch() / public void setHeaderMarginInch(double value) |
getLeftMargin/setLeftMargin | |
public double getLeftMargin() / public void setLeftMargin(double value) |
getLeftMarginInch/setLeftMarginInch | |
public double getLeftMarginInch() / public void setLeftMarginInch(double value) |
getRightMargin/setRightMargin | |
public double getRightMargin() / public void setRightMargin(double value) |
getRightMarginInch/setRightMarginInch | |
public double getRightMarginInch() / public void setRightMarginInch(double value) |
getTopMargin/setTopMargin | |
public double getTopMargin() / public void setTopMargin(double value) |
getTopMarginInch/setTopMarginInch | |
public double getTopMarginInch() / public void setTopMarginInch(double value) |
getBottomMargin/setBottomMargin | |
public double getBottomMargin() / public void setBottomMargin(double value) |
getBottomMarginInch/setBottomMarginInch | |
public double getBottomMarginInch() / public void setBottomMarginInch(double value) |
getFirstPageNumber/setFirstPageNumber | |
public int getFirstPageNumber() / public void setFirstPageNumber(int value) |
getFitToPagesTall/setFitToPagesTall | |
public int getFitToPagesTall() / public void setFitToPagesTall(int value) |
getFitToPagesWide/setFitToPagesWide | |
public int getFitToPagesWide() / public void setFitToPagesWide(int value) |
isPercentScale/setPercentScale | |
public boolean isPercentScale() / public void setPercentScale(boolean value) |
getOrder/setOrder | |
public int getOrder() / public void setOrder(int value) |
getPaperSize/setPaperSize | |
public int getPaperSize() / public void setPaperSize(int value) |
getOrientation/setOrientation | |
public int getOrientation() / public void setOrientation(int value) |
getPrintComments/setPrintComments | |
public int getPrintComments() / public void setPrintComments(int value) |
getPrintErrors/setPrintErrors | |
public int getPrintErrors() / public void setPrintErrors(int value) |
getPrintHeadings/setPrintHeadings | |
public boolean getPrintHeadings() / public void setPrintHeadings(boolean value) |
getPrintGridlines/setPrintGridlines | |
public boolean getPrintGridlines() / public void setPrintGridlines(boolean value) |
getZoom/setZoom | |
public int getZoom() / public void setZoom(int value) |
isAutoFirstPageNumber/setAutoFirstPageNumber | |
public boolean isAutoFirstPageNumber() / public void setAutoFirstPageNumber(boolean value) |
getPrintQuality/setPrintQuality | |
public int getPrintQuality() / public void setPrintQuality(int value) |
getPrintCopies/setPrintCopies | |
public int getPrintCopies() / public void setPrintCopies(int value) |
isHFDiffOddEven/setHFDiffOddEven | |
public boolean isHFDiffOddEven() / public void setHFDiffOddEven(boolean value) |
isHFDiffFirst/setHFDiffFirst | |
public boolean isHFDiffFirst() / public void setHFDiffFirst(boolean value) |
isHFScaleWithDoc/setHFScaleWithDoc | |
public boolean isHFScaleWithDoc() / public void setHFScaleWithDoc(boolean value) |
isHFAlignMargins/setHFAlignMargins | |
public boolean isHFAlignMargins() / public void setHFAlignMargins(boolean value) |
getPrintArea/setPrintArea | |
public java.lang.String getPrintArea() / public void setPrintArea(java.lang.String value) |
Method Detail |
---|
setHeaderPicture | |
public Picture setHeaderPicture(int section, byte[] headerPicture) throws java.lang.Exception |
section
- 0:Left Section.
1:Center Section
2:Right Section
headerPicture
- Image data.setFooterPicture | |
public Picture setFooterPicture(int section, byte[] footerPicture) throws java.lang.Exception |
section
- 0:Left Section.
1:Center Section
2:Right Section
footerPicture
- Image data.getPicture | |
public Picture getPicture(boolean isHeader, int section) |
isHeader
- Indicates whether it is in the header or footer.section
- 0:Left Section.
1:Center Section
2:Right Section
clearHeaderFooter | |
public void clearHeaderFooter() |
getHeader | |
public java.lang.String getHeader(int section) |
section
- 0:Left Section.
1:Center Section
2:Right Section
getCommands | |
public com.aspose.cells.HeaderFooterCommand[] getCommands(java.lang.String headerFooterScript) |
headerFooterScript
- The header/footer scriptgetFooter | |
public java.lang.String getFooter(int section) |
section
- 0:Left Section.
1:Center Section
2:Right Section
setHeader | |
public void setHeader(int section, java.lang.String headerScript) |
Script commands:
Command | Description |
&P | Current page number |
&N | Page count |
&D | Current date |
&T | Current time |
&A | Sheet name |
&F | File 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 |
&G | Image script |
section
- 0:Left Section.
1:Center Section
2:Right Section
headerScript
- Header format script.setFooter | |
public void setFooter(int section, java.lang.String footerScript) |
Script commands:
Command | Description |
&P | Current page number |
&N | Page count |
&D | Current date |
&T | Current time |
&A | Sheet name |
&F | File 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. |
&G | Image script |
section
- 0:Left Section.
1:Center Section
2:Right Section
footerScript
- Footer format script.setEvenHeader | |
public void setEvenHeader(int section, java.lang.String headerScript) |
section
- 0:Left Section.
1:Center Section
2:Right Section
headerScript
- Header format script.getEvenHeader | |
public java.lang.String getEvenHeader(int section) |
section
- 0:Left Section.
1:Center Section
2:Right Section
setEvenFooter | |
public void setEvenFooter(int section, java.lang.String footerScript) |
section
- 0:Left Section.
1:Center Section
2:Right Section
footerScript
- Footer format script.getEvenFooter | |
public java.lang.String getEvenFooter(int section) |
section
- 0:Left Section.
1:Center Section
2:Right Section
setFirstPageHeader | |
public void setFirstPageHeader(int section, java.lang.String headerScript) |
section
- 0:Left Section.
1:Center Section
2:Right Section
headerScript
- Header format script.getFirstPageHeader | |
public java.lang.String getFirstPageHeader(int section) |
section
- 0:Left Section.
1:Center Section
2:Right Section
setFirstPageFooter | |
public void setFirstPageFooter(int section, java.lang.String footerScript) |
section
- 0:Left Section.
1:Center Section
2:Right Section
footerScript
- Footer format script.getFirstPageFooter | |
public java.lang.String getFirstPageFooter(int section) |
section
- 0:Left Section.
1:Center Section
2:Right Section