|
||
| Home Products Purchase Downloads Demos Forums Blogs Ticket Wiki API Corporate | ||
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.aspose.cells.PageSetup
public class PageSetup
Encapsulates the object that represents the page setup description. The PageSetup object contains all page setup options.
| Method Summary | |
|---|---|
void |
addPicture(boolean isHeader,
int section,
java.io.InputStream inputStream)
Add a picture to header/footer. |
void |
addPicture(boolean isHeader,
int section,
java.lang.String fileName)
Add a picture to header/footer. |
double |
getBottomMargin()
Gets the size of the bottom margin, in unit of centimeters. |
double |
getBottomMarginInch()
Gets the size of the bottom margin, in unit of inches. |
java.lang.String |
getCenterFooter()
Gets a script formatting the center section footer of an Workbook file. |
java.lang.String |
getCenterHeader()
Gets a script formatting the center section header of an Workbook file. |
int |
getCopies()
Gets number of copies to print. |
short |
getFirstPageNumber()
Gets the first page number that will be used when this sheet is printed. |
short |
getFitToPagesTall()
Gets the number of pages tall the worksheet will be scaled to when it's printed. |
short |
getFitToPagesWide()
Gets the number of pages wide the worksheet will be scaled to when it's printed. |
double |
getFooterMargin()
Gets the distance from the bottom of the page to the footer, in unit of centimeters. |
double |
getFooterMarginInch()
Gets the distance from the bottom of the page to the footer, in unit of inches. |
double |
getHeaderMargin()
Gets the distance from the top of the page to the header, in unit of centimeters. |
double |
getHeaderMarginInch()
Gets the distance from the top of the page to the header, in unit of inches. |
java.lang.String |
getLeftFooter()
Gets a script formatting the left section footer of an Workbook file. |
java.lang.String |
getLeftHeader()
Gets a script formatting the left section header of an Workbook file. |
double |
getLeftMargin()
Gets the size of the left margin, in unit of centimeters. |
double |
getLeftMarginInch()
Gets the size of the left margin, in unit of inches. |
short |
getOrientation()
Gets page print orientation. |
short |
getPageOrder()
Gets the order that Microsoft Workbook uses to number pages when printing a large worksheet. |
short |
getPaperSize()
Gets the size of the paper. |
java.lang.String |
getPrintArea()
Gets the range to be printed. |
short |
getPrintComments()
Gets the way comments are printed with the sheet. |
short |
getPrintErrors()
Gets the type of print error displayed. |
short |
getPrintQuality()
Gets the print quality. |
java.lang.String |
getPrintTitleColumns()
Gets the columns that contain the cells to be repeated on the left side of each page. |
java.lang.String |
getPrintTitleRows()
Gets the rows that contain the cells to be repeated at the top of each page. |
java.lang.String |
getRightFooter()
Gets a script formatting the right section footer of an Workbook file. |
java.lang.String |
getRightHeader()
Gets a script formatting the right section header of an Workbook file. |
double |
getRightMargin()
Gets the size of the right margin, in unit of centimeters. |
double |
getRightMarginInch()
Gets the size of the right margin, in unit of inches. |
double |
getTopMargin()
Gets the size of the top margin, in unit of centimeters. |
double |
getTopMarginInch()
Gets the size of the top margin, in unit of inches. |
short |
getZoom()
Gets the scaling factor in percent. |
boolean |
isBlackAndWhite()
Indicates whether elements of the document will be printed in black and white. |
boolean |
isCenterHorizontally()
Indicates whether the sheet is printed centered horizontally. |
boolean |
isCenterVertically()
Indicates whether the sheet is printed centered vertically. |
boolean |
isDraftQuality()
Indicats whether the sheet will be printed without graphics. |
boolean |
isPrintGridlines()
Indicates cell gridlines are printed on the page. |
boolean |
isPrintHeadings()
Indicates whether row and column headings are printed with this page. |
void |
setBlackAndWhite(boolean blackAndWhite)
Sets elements of the document will be printed in black and white. |
void |
setBottomMargin(double bottomMargin)
Sets the size of the bottom margin, in unit of centimeters. |
void |
setBottomMarginInch(double bottomMargin)
Sets the size of the bottom margin, in unit of inches . |
void |
setCenterFooter(java.lang.String centerFooter)
Sets a script formatting the center section footer of an Workbook file. |
void |
setCenterHeader(java.lang.String centerHeader)
Sets na script formatting the center section header of an Workbook file |
void |
setCenterHorizontally(boolean centerHorizontally)
Sets whether the sheet is printed centered horizontally. |
void |
setCenterVertically(boolean centerVertically)
Sets whether the sheet is printed centered vertically. |
void |
setCopies(int copies)
Sets number of copies to print. |
void |
setDraftQuality(boolean draftQuality)
Sets whether the sheet will be printed without graphics. |
void |
setFirstPageNumber(int firstPageNumber)
Sets the first page number that will be used when this sheet is printed. |
void |
setFitToPagesTall(int fitToPagesTall)
Sets the number of pages tall the worksheet will be scaled to when it's printed. |
void |
setFitToPagesWide(int fitToPagesWide)
Sets the number of pages wide the worksheet will be scaled to when it's printed. |
void |
setFooterMargin(double footerMargin)
Sets the distance from the bottom of the page to the footer, in unit of centimeters. |
void |
setFooterMarginInch(double footerMargin)
Sets the distance from the bottom of the page to the footer, in unit of inches. |
void |
setHeaderMargin(double headerMargin)
Sets the distance from the top of the page to the header, in unit of centimeters. |
void |
setHeaderMarginInch(double headerMargin)
Sets the distance from the top of the page to the header, in unit of inches. |
void |
setLeftFooter(java.lang.String leftFooter)
Sets a script formatting the left section footer of an Workbook file. |
void |
setLeftHeader(java.lang.String leftHeader)
Sets a script formatting the left section header of an Workbook file. |
void |
setLeftMargin(double leftMargin)
Sets the size of the left margin, in unit of centimeters. |
void |
setLeftMarginInch(double leftMargin)
Sets the size of the left margin, in unit of inches. |
void |
setOrientation(short orientation)
Sets orientation page print orientation. |
void |
setPageOrder(short pageOrder)
Sets the order that Microsoft Workbook uses to number pages when printing a large worksheet. |
void |
setPaperSize(short paperSize)
Sets the size of the paper. |
void |
setPrintArea(java.lang.String printArea)
Sets the range to be printed. |
void |
setPrintComments(short printComments)
Sets the way comments are printed with the sheet. |
void |
setPrintErrors(short printErrors)
Gets the type of print error displayed. |
void |
setPrintGridlines(boolean printGridlines)
Sets whether cell gridlines are printed on the page. |
void |
setPrintHeadings(boolean printHeadings)
Sets whether row and column headings are printed with this page. |
void |
setPrintQuality(int printQuality)
Sets the print quality. |
void |
setPrintTitleColumns(java.lang.String printTitleColumns)
Sets the columns that contain the cells to be repeated on the left side of each page. |
void |
setPrintTitleRows(java.lang.String printTitleRows)
Sets the rows that contain the cells to be repeated at the top of each page. |
void |
setRightFooter(java.lang.String rightFooter)
Sets a script formatting the right section footer of an Workbook file. |
void |
setRightHeader(java.lang.String rightHeader)
Sets a script formatting the right section header of an Workbook file. |
void |
setRightMargin(double rightMargin)
Sets the size of the right margin, in unit of centimeters. |
void |
setRightMarginInch(double rightMargin)
Sets the size of the right margin, in unit of inches. |
void |
setTopMargin(double topMargin)
Sets the size of the top margin, in unit of centimeters. |
void |
setTopMarginInch(double topMargin)
Sets the size of the top margin, in unit of inches. |
void |
setZoom(int zoom)
Sets the scaling factor in percent. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public boolean isBlackAndWhite()
public void setBlackAndWhite(boolean blackAndWhite)
blackAndWhite - whether elements of the document will be printed in black and
white.
CellsException - if the Page Setup Object has been destroyed.public double getBottomMargin()
public void setBottomMargin(double bottomMargin)
bottomMargin - the size of the bottom margin, in unit of centimeters.
CellsException - if the Page Setup Object has been destroyed.public double getBottomMarginInch()
public void setBottomMarginInch(double bottomMargin)
bottomMargin - the size of the bottom margin, in unit of inches.
CellsException - if the Page Setup Object has been destroyed.public boolean isCenterHorizontally()
public void setCenterHorizontally(boolean centerHorizontally)
centerHorizontally - whether the sheet is printed centered horizontally.
CellsException - if the Page Setup Object has been destroyed.public boolean isCenterVertically()
public void setCenterVertically(boolean centerVertically)
centerVertically - whether the sheet is printed centered vertically.
CellsException - if the Page Setup Object has been destroyed.public boolean isDraftQuality()
public void setDraftQuality(boolean draftQuality)
draftQuality - whether the sheet will be printed without graphics.
CellsException - if the Page Setup Object has been destroyed.public short getFitToPagesTall()
public void setFitToPagesTall(int fitToPagesTall)
fitToPagesTall - the number of pages tall the worksheet will be scaled to when
it's printed.
java.lang.IllegalArgumentException - if fitToPagesTall <1.
CellsException - if the Page Setup Object has been destroyed.public short getFitToPagesWide()
public void setFitToPagesWide(int fitToPagesWide)
fitToPagesWide - the number of pages wide the worksheet will be scaled to when
it's printed.
java.lang.IllegalArgumentException - if fitToPagesWide <1.
CellsException - if the Page Setup Object has been destroyed.public double getFooterMargin()
public void setFooterMargin(double footerMargin)
footerMargin - the distance from the bottom of the page to the footer, in unit
of centimeters.
CellsException - if the Page Setup Object has been destroyed.public double getFooterMarginInch()
public void setFooterMarginInch(double footerMargin)
footerMargin - the distance from the bottom of the page to the footer, in unit
of inches.
CellsException - if the Page Setup Object has been destroyed.public double getHeaderMargin()
public void setHeaderMargin(double headerMargin)
headerMargin - the distance from the top of the page to the header, in unit of
centimeters.
CellsException - if the Page Setup Object has been destroyed.public double getHeaderMarginInch()
public void setHeaderMarginInch(double headerMargin)
headerMargin - the distance from the top of the page to the header, in unit of
inches.
CellsException - if the Page Setup Object has been destroyed.public java.lang.String getCenterFooter()
setCenterFooter(String)public void setCenterFooter(java.lang.String centerFooter)
centerFooter - a script formatting the center section footer of an Workbook file.
| Command | Description |
| &P | Current page number |
| &G | Picture |
| &N | Page count |
| &D | Current date |
| &T | Current time |
| &A | Sheet name |
| &F | File name without path |
| &Z | File name with path |
| &B | Bold |
| &I | Italic |
| &U | Underlining |
| &E | Double underlining |
| &X | Superscript |
| &Y | Subscript |
| &S | Strikeout |
| &"<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. |
CellsException - if the Page Setup Object has been destroyed.public java.lang.String getCenterHeader()
setCenterFooter(String)public void setCenterHeader(java.lang.String centerHeader)
centerHeader - a script formatting the center section header of an Workbook file
CellsException - if the Page Setup Object has been destroyed.setCenterFooter(String)public java.lang.String getLeftFooter()
setCenterFooter(String)public void setLeftFooter(java.lang.String leftFooter)
leftFooter - a script formatting the left section footer of an Workbook file.
CellsException - if the Page Setup Object has been destroyed.setCenterFooter(String)public java.lang.String getLeftHeader()
setCenterFooter(String)public void setLeftHeader(java.lang.String leftHeader)
leftHeader - a script formatting the left section header of an Workbook file.
CellsException - if the Page Setup Object has been destroyed.setCenterFooter(String)
public void addPicture(boolean isHeader,
int section,
java.lang.String fileName)
isHeader - true :add a picture to header;false :add to footer.section - 0:Left Section,1:Center Section,2:Right Section.fileName - picture file name.
public void addPicture(boolean isHeader,
int section,
java.io.InputStream inputStream)
isHeader - true :add a picture to header;false :add to footer.section - 0:Left Section,1:Center Section,2:Right Section.inputStream - picture input stream.public java.lang.String getRightFooter()
setCenterFooter(String)public void setRightFooter(java.lang.String rightFooter)
rightFooter - a script formatting the right section footer of an Workbook file.
CellsException - if the Page Setup Object has been destroyed.setCenterFooter(String)public java.lang.String getRightHeader()
setCenterFooter(String)public void setRightHeader(java.lang.String rightHeader)
rightHeader - a script formatting the right section header of an Workbook file.
CellsException - if the Page Setup Object has been destroyed.setCenterFooter(String)public double getLeftMargin()
public void setLeftMargin(double leftMargin)
leftMargin - the size of the left margin, in unit of centimeters.
CellsException - if the Page Setup Object has been destroyed.public double getLeftMarginInch()
public void setLeftMarginInch(double leftMargin)
leftMargin - the size of the left margin, in unit of inches.
CellsException - if the Page Setup Object has been destroyed.public short getOrientation()
setOrientation(short)public void setOrientation(short orientation)
orientation - page print orientation. It could be one of the following values:
| PageOrientationType.LANDSCAPE |
| PageOrientationType.PORTRAIT |
java.lang.IllegalArgumentException - if page orientation type is invalid.
CellsException - if the Page Setup Object has been destroyed.public short getPageOrder()
public void setPageOrder(short pageOrder)
pageOrder - the order that Microsoft Workbook uses to number pages when
printing a large worksheet.It could be one of the following values:
| OrderType.DOWN_THEN_OVER |
| OrderType.OVER_THEN_DOWN |
java.lang.IllegalArgumentException - if page order type is not valid.
CellsException - if the Page Setup Object has been destroyed.public java.lang.String getPrintArea()
public void setPrintArea(java.lang.String printArea)
printArea - the range to be printed.
CellsException - if the Page Setup Object has been destroyed.public short getPrintComments()
setPrintComments(short)public void setPrintComments(short printComments)
printComments - the way comments are printed with the sheet. It could be one of
the following values: | PrintCommentsType.PRINT_IN_PLACE |
| PrintCommentsType.PRINT_NO_COMMNENTS |
| PrintCommentsType.PRINT_SHEET_END |
java.lang.IllegalArgumentException - if print commnets type is invalid.
CellsException - if the Page Setup Object has been destroyed.public short getPrintErrors()
setPrintErrors(short)public void setPrintErrors(short printErrors)
printErrors - the type of print error displayed.It could be one of the following values:
| PrintErrorsType.PRINT_ERRORS_BLANK |
| PrintErrorsType.PRINT_ERRORS_DASH |
| PrintErrorsType.PRINT_ERRORS_DISPLAYED |
| PrintErrorsType.PRINT_ERRORS_NA |
java.lang.IllegalArgumentException - if print errors type is invalid.
CellsException - if the Page Setup Object has been destroyed.public boolean isPrintGridlines()
public void setPrintGridlines(boolean printGridlines)
printGridlines - whether cell gridlines are printed on the page.
CellsException - if the Page Setup Object has been destroyed.public boolean isPrintHeadings()
public void setPrintHeadings(boolean printHeadings)
printHeadings - whether row and column headings are printed with this page.
CellsException - if the Page Setup Object has been destroyed.public short getPrintQuality()
public void setPrintQuality(int printQuality)
printQuality - the print quality.
java.lang.IllegalArgumentException - if printQuality is less than 0.
CellsException - if the Page Setup Object has been destroyed.public java.lang.String getPrintTitleColumns()
public void setPrintTitleColumns(java.lang.String printTitleColumns)
printTitleColumns - the columns that contain the cells to be repeated on the left side of
each page.
CellsException - if the Page Setup Object has been destroyed.
java.lang.IllegalArgumentException - if print titles columns are invalid.public java.lang.String getPrintTitleRows()
public void setPrintTitleRows(java.lang.String printTitleRows)
printTitleRows - the rows that contain the cells to be repeated at the top of
each page.
CellsException - if the Page Setup Object has been destroyed.
java.lang.IllegalArgumentException - if print titles rows are invalid.public double getRightMargin()
public void setRightMargin(double rightMargin)
rightMargin - the size of the right margin, in unit of centimeters.
CellsException - if the Page Setup Object has been destroyed.public double getRightMarginInch()
public void setRightMarginInch(double rightMargin)
rightMargin - the size of the right margin, in unit of inches.
CellsException - if the Page Setup Object has been destroyed.public double getTopMargin()
public void setTopMargin(double topMargin)
topMargin - the size of the top margin, in unit of centimeters.
CellsException - if the Page Setup Object has been destroyed.public double getTopMarginInch()
public void setTopMarginInch(double topMargin)
topMargin - the size of the top margin, in unit of inches.
CellsException - if the Page Setup Object has been destroyed.public short getZoom()
public void setZoom(int zoom)
zoom - the scaling factor in percent. It should be between 10 and 400.
java.lang.IllegalArgumentException - if zoom is not between 10 and 400.
CellsException - if the Page Setup Object has been destroyed.public short getPaperSize()
public void setPaperSize(short paperSize)
paperSize - the size of the paper.It could be one of the members of PaperSizeType.
java.lang.IllegalArgumentException - if page size type is not valid.
CellsException - if the Page Setup Object has been destroyed.PaperSizeTypepublic short getFirstPageNumber()
public void setFirstPageNumber(int firstPageNumber)
firstPageNumber - the first page number that will be used when this sheet is
printed.
CellsException - if the Page Setup Object has been destroyed.public int getCopies()
public void setCopies(int copies)
copies - number of copies to print.
CellsException - if the Page Setup Object has been destroyed.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||