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(booleanvalue) | |
Represents if elements of the document will be printed in black and white. | ||
double | getBottomMargin() | |
void | setBottomMargin(doublevalue) | |
Represents the size of the bottom margin, in unit of centimeters. | ||
double | getBottomMarginInch() | |
void | setBottomMarginInch(doublevalue) | |
Represents the size of the bottom margin, in unit of inches. | ||
boolean | getCenterHorizontally() | |
void | setCenterHorizontally(booleanvalue) | |
Represent if the sheet is printed centered horizontally. | ||
boolean | getCenterVertically() | |
void | setCenterVertically(booleanvalue) | |
Represent if the sheet is printed centered vertically. | ||
int | getFirstPageNumber() | |
void | setFirstPageNumber(intvalue) | |
Represents the first page number that will be used when this sheet is printed. | ||
int | getFitToPagesTall() | |
void | setFitToPagesTall(intvalue) | |
Represents the number of pages tall the worksheet will be scaled to when it's printed. The default value is 1. | ||
int | getFitToPagesWide() | |
void | setFitToPagesWide(intvalue) | |
Represents the number of pages wide the worksheet will be scaled to when it's printed. The default value is 1. | ||
double | getFooterMargin() | |
void | setFooterMargin(doublevalue) | |
Represents the distance from the bottom of the page to the footer, in unit of centimeters. | ||
double | getFooterMarginInch() | |
void | setFooterMarginInch(doublevalue) | |
Represents the distance from the bottom of the page to the footer, in unit of inches. | ||
double | getHeaderMargin() | |
void | setHeaderMargin(doublevalue) | |
Represents the distance from the top of the page to the header, in unit of centimeters. | ||
double | getHeaderMarginInch() | |
void | setHeaderMarginInch(doublevalue) | |
Represents the distance from the top of the page to the header, in unit of inches. | ||
boolean | isAutoFirstPageNumber() | |
void | setAutoFirstPageNumber(booleanvalue) | |
Indicates whether the first the page number is automatically assigned. | ||
boolean | isAutomaticPaperSize() | |
Indicates whether the paper size is automatic.
|
||
boolean | isHFAlignMargins() | |
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. | ||
boolean | isHFDiffFirst() | |
void | setHFDiffFirst(booleanvalue) | |
True means that the header/footer of the first page is different with other pages. | ||
boolean | isHFDiffOddEven() | |
void | setHFDiffOddEven(booleanvalue) | |
True means that the header/footer of the odd pages is different with odd pages. | ||
boolean | isHFScaleWithDoc() | |
void | setHFScaleWithDoc(booleanvalue) | |
Indicates whether header and footer are scaled with document scaling. Only applies for Excel 2007. | ||
boolean | isPercentScale() | |
void | setPercentScale(booleanvalue) | |
If this property is False, the FitToPagesWide and FitToPagesTall properties control how the worksheet is scaled. | ||
double | getLeftMargin() | |
void | setLeftMargin(doublevalue) | |
Represents the size of the left margin, in unit of centimeters. | ||
double | getLeftMarginInch() | |
void | setLeftMarginInch(doublevalue) | |
Represents the size of the left margin, in unit of inches. | ||
OdsPageBackground | getODSPageBackground() | |
Gets the background of ODS.
|
||
int | getOrder() | |
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. | ||
int | getOrientation() | |
void | setOrientation(intvalue) | |
Represents page print orientation. The value of the property is PageOrientationType integer constant. | ||
double | getPaperHeight() | |
Represents the height in inches of the paper, considered page orientation.
|
||
int | getPaperSize() | |
void | setPaperSize(intvalue) | |
Represents the size of the paper. The value of the property is PaperSizeType integer constant. | ||
double | getPaperWidth() | |
Represents the width in inches of the paper, considered page orientation.
|
||
java.lang.String | getPrintArea() | |
void | setPrintArea(java.lang.Stringvalue) | |
Represents the range to be printed. | ||
int | getPrintComments() | |
void | setPrintComments(intvalue) | |
Represents the way comments are printed with the sheet. The value of the property is PrintCommentsType integer constant. | ||
int | getPrintCopies() | |
void | setPrintCopies(intvalue) | |
Get and sets number of copies to print. | ||
boolean | getPrintDraft() | |
void | setPrintDraft(booleanvalue) | |
Represents if the sheet will be printed without graphics. | ||
int | getPrintErrors() | |
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. | ||
boolean | getPrintGridlines() | |
void | setPrintGridlines(booleanvalue) | |
Represents if cell gridlines are printed on the page. | ||
boolean | getPrintHeadings() | |
void | setPrintHeadings(booleanvalue) | |
Represents if row and column headings are printed with this page. | ||
int | getPrintQuality() | |
void | setPrintQuality(intvalue) | |
Represents the print quality. | ||
java.lang.String | getPrintTitleColumns() | |
void | setPrintTitleColumns(java.lang.Stringvalue) | |
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.Stringvalue) | |
Represents the rows that contain the cells to be repeated at the top of each page. | ||
double | getRightMargin() | |
void | setRightMargin(doublevalue) | |
Represents the size of the right margin, in unit of centimeters. | ||
double | getRightMarginInch() | |
void | setRightMarginInch(doublevalue) | |
Represents the size of the right margin, in unit of inches. | ||
double | getTopMargin() | |
void | setTopMargin(doublevalue) | |
Represents the size of the top margin, in unit of centimeters. | ||
double | getTopMarginInch() | |
void | setTopMarginInch(doublevalue) | |
Represents the size of the top margin, in unit of inches. | ||
int | getZoom() | |
void | setZoom(intvalue) | |
Represents the scaling factor in percent. It should be between 10 and 400. |
Method Summary | ||
---|---|---|
void | clearHeaderFooter() | |
Clears header and footer setting.
|
||
void | copy(PageSetup source, CopyOptions copyOptions) | |
Copys the setting of the page setup.
|
||
void | customPaperSize(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.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 isFirst, boolean isEven, boolean isHeader, int section) | |
Gets the |
||
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 | setFitToPages(int wide, int tall) | |
Sets the number of pages the worksheet will be scaled to when it's printed.
|
||
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.
|
||
Picture | setPicture(boolean isFirst, boolean isEven, boolean isHeader, int section, byte[] imageData) | |
Sets an image in the header/footer of a worksheet.
|
public OdsPageBackground getODSPageBackground()
public java.lang.String getPrintArea() / public void setPrintArea(java.lang.String value)
public java.lang.String getPrintTitleColumns() / public void setPrintTitleColumns(java.lang.String value)
public java.lang.String getPrintTitleRows() / public void setPrintTitleRows(java.lang.String value)
public boolean getBlackAndWhite() / public void setBlackAndWhite(boolean value)
public boolean getCenterHorizontally() / public void setCenterHorizontally(boolean value)
public boolean getCenterVertically() / public void setCenterVertically(boolean value)
public boolean getPrintDraft() / public void setPrintDraft(boolean value)
public double getFooterMargin() / public void setFooterMargin(double value)
public double getFooterMarginInch() / public void setFooterMarginInch(double value)
public double getHeaderMargin() / public void setHeaderMargin(double value)
public double getHeaderMarginInch() / public void setHeaderMarginInch(double value)
public byte[] getPrinterSettings() / public void setPrinterSettings(byte[] value)
public double getLeftMargin() / public void setLeftMargin(double value)
public double getLeftMarginInch() / public void setLeftMarginInch(double value)
public double getRightMargin() / public void setRightMargin(double value)
public double getRightMarginInch() / public void setRightMarginInch(double value)
public double getTopMargin() / public void setTopMargin(double value)
public double getTopMarginInch() / public void setTopMarginInch(double value)
public double getBottomMargin() / public void setBottomMargin(double value)
public double getBottomMarginInch() / public void setBottomMarginInch(double value)
public int getFirstPageNumber() / public void setFirstPageNumber(int value)
public int getFitToPagesTall() / public void setFitToPagesTall(int value)
public int getFitToPagesWide() / public void setFitToPagesWide(int value)
public boolean isPercentScale() / public void setPercentScale(boolean value)
public int getOrder() / public void setOrder(int value)
public boolean isAutomaticPaperSize()
public int getPaperSize() / public void setPaperSize(int value)
public double getPaperWidth()
public double getPaperHeight()
public int getOrientation() / public void setOrientation(int value)
public int getPrintComments() / public void setPrintComments(int value)
public int getPrintErrors() / public void setPrintErrors(int value)
public boolean getPrintHeadings() / public void setPrintHeadings(boolean value)
public boolean getPrintGridlines() / public void setPrintGridlines(boolean value)
public int getZoom() / public void setZoom(int value)
public boolean isAutoFirstPageNumber() / public void setAutoFirstPageNumber(boolean value)
public int getPrintQuality() / public void setPrintQuality(int value)
public int getPrintCopies() / public void setPrintCopies(int value)
public boolean isHFDiffOddEven() / public void setHFDiffOddEven(boolean value)
public boolean isHFDiffFirst() / public void setHFDiffFirst(boolean value)
public boolean isHFScaleWithDoc() / public void setHFScaleWithDoc(boolean value)
public boolean isHFAlignMargins() / public void setHFAlignMargins(boolean value)
public Picture setHeaderPicture(int section, byte[] headerPicture)
section
- 0:Left Section.
1:Center Section
2:Right Section
headerPicture
- Image data.public Picture setFooterPicture(int section, byte[] footerPicture)
section
- 0:Left Section.
1:Center Section
2:Right Section
footerPicture
- Image data.public Picture setPicture(boolean isFirst, boolean isEven, boolean isHeader, int section, byte[] imageData)
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.public Picture getPicture(boolean isHeader, int section)
public Picture getPicture(boolean isFirst, boolean isEven, boolean isHeader, int section)
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
public void copy(PageSetup source, CopyOptions copyOptions) throws java.lang.Exception
source
- The source.copyOptions
- The copy options.public void setFitToPages(int wide, int tall)
wide
- Pages wide.tall
- Pages tall.public void customPaperSize(double width, double height)
width
- The width of the paper. height
- The height of the paper.public void clearHeaderFooter()
public java.lang.String getHeader(int section)
section
- 0:Left Section.
1:Center Section
2:Right Section
public com.aspose.cells.HeaderFooterCommand[] getCommands(java.lang.String headerFooterScript)
headerFooterScript
- The header/footer scriptpublic java.lang.String getFooter(int section)
section
- 0:Left Section.
1:Center Section
2:Right Section
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.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.public void setEvenHeader(int section, java.lang.String headerScript)
section
- 0:Left Section.
1:Center Section
2:Right Section
headerScript
- Header format script.public java.lang.String getEvenHeader(int section)
section
- 0:Left Section.
1:Center Section
2:Right Section
public void setEvenFooter(int section, java.lang.String footerScript)
section
- 0:Left Section.
1:Center Section
2:Right Section
footerScript
- Footer format script.public java.lang.String getEvenFooter(int section)
section
- 0:Left Section.
1:Center Section
2:Right Section
public void setFirstPageHeader(int section, java.lang.String headerScript)
section
- 0:Left Section.
1:Center Section
2:Right Section
headerScript
- Header format script.public java.lang.String getFirstPageHeader(int section)
section
- 0:Left Section.
1:Center Section
2:Right Section
public void setFirstPageFooter(int section, java.lang.String footerScript)
section
- 0:Left Section.
1:Center Section
2:Right Section
footerScript
- Footer format script.public java.lang.String getFirstPageFooter(int section)
section
- 0:Left Section.
1:Center Section
2:Right Section