Example:
$workbook = new cells\Workbook(); $sheet = $workbook->getWorksheets()->get(0); $pagesetup = $sheet->getPageSetup(); $pagesetup->setPrintArea("D1:K13"); $pagesetup->setPrintTitleRows("\$5:\$7"); $pagesetup->setPrintTitleColumns("\$A:\$B");
Property Getters/Setters Summary | ||
---|---|---|
function | getBlackAndWhite() | |
function | setBlackAndWhite(value) | |
Represents if elements of the document will be printed in black and white. | ||
function | getBottomMargin() | |
function | setBottomMargin(value) | |
Represents the size of the bottom margin, in unit of centimeters. | ||
function | getBottomMarginInch() | |
function | setBottomMarginInch(value) | |
Represents the size of the bottom margin, in unit of inches. | ||
function | getCenterHorizontally() | |
function | setCenterHorizontally(value) | |
Represent if the sheet is printed centered horizontally. | ||
function | getCenterVertically() | |
function | setCenterVertically(value) | |
Represent if the sheet is printed centered vertically. | ||
function | getFirstPageNumber() | |
function | setFirstPageNumber(value) | |
Represents the first page number that will be used when this sheet is printed. | ||
function | getFitToPagesTall() | |
function | setFitToPagesTall(value) | |
Represents the number of pages tall the worksheet will be scaled to when it's printed. The default value is 1. | ||
function | getFitToPagesWide() | |
function | setFitToPagesWide(value) | |
Represents the number of pages wide the worksheet will be scaled to when it's printed. The default value is 1. | ||
function | getFooterMargin() | |
function | setFooterMargin(value) | |
Represents the distance from the bottom of the page to the footer, in unit of centimeters. | ||
function | getFooterMarginInch() | |
function | setFooterMarginInch(value) | |
Represents the distance from the bottom of the page to the footer, in unit of inches. | ||
function | getHeaderMargin() | |
function | setHeaderMargin(value) | |
Represents the distance from the top of the page to the header, in unit of centimeters. | ||
function | getHeaderMarginInch() | |
function | setHeaderMarginInch(value) | |
Represents the distance from the top of the page to the header, in unit of inches. | ||
function | isAutoFirstPageNumber() | |
function | setAutoFirstPageNumber(value) | |
Indicates whether the first the page number is automatically assigned. | ||
function | isAutomaticPaperSize() | |
Indicates whether the paper size is automatic. | ||
function | isHFAlignMargins() | |
function | setHFAlignMargins(value) | |
Indicates whether header and footer margins are aligned with the page margins. Only applies for Excel 2007. | ||
function | isHFDiffFirst() | |
function | setHFDiffFirst(value) | |
True means that the header/footer of the first page is different with other pages. | ||
function | isHFDiffOddEven() | |
function | setHFDiffOddEven(value) | |
True means that the header/footer of the odd pages is different with odd pages. | ||
function | isHFScaleWithDoc() | |
function | setHFScaleWithDoc(value) | |
Indicates whether header and footer are scaled with document scaling. Only applies for Excel 2007. | ||
function | isPercentScale() | |
function | setPercentScale(value) | |
If this property is False, the FitToPagesWide and FitToPagesTall properties control how the worksheet is scaled. | ||
function | getLeftMargin() | |
function | setLeftMargin(value) | |
Represents the size of the left margin, in unit of centimeters. | ||
function | getLeftMarginInch() | |
function | setLeftMarginInch(value) | |
Represents the size of the left margin, in unit of inches. | ||
function | getOrder() | |
function | setOrder(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. | ||
function | getOrientation() | |
function | setOrientation(value) | |
Represents page print orientation. The value of the property is PageOrientationType integer constant. | ||
function | getPaperHeight() | |
Represents the height in inches of the paper, considered page orientation. | ||
function | getPaperSize() | |
function | setPaperSize(value) | |
Represents the size of the paper. The value of the property is PaperSizeType integer constant. | ||
function | getPaperWidth() | |
Represents the width in inches of the paper, considered page orientation. | ||
function | getPrintArea() | |
function | setPrintArea(value) | |
Represents the range to be printed. | ||
function | getPrintComments() | |
function | setPrintComments(value) | |
Represents the way comments are printed with the sheet. The value of the property is PrintCommentsType integer constant. | ||
function | getPrintCopies() | |
function | setPrintCopies(value) | |
Get and sets number of copies to print. | ||
function | getPrintDraft() | |
function | setPrintDraft(value) | |
Represents if the sheet will be printed without graphics. | ||
function | getPrintErrors() | |
function | setPrintErrors(value) | |
Specifies the type of print error displayed. The value of the property is PrintErrorsType integer constant. | ||
function | getPrinterSettings() | |
function | setPrinterSettings(value) | |
Gets and sets the settings of the default printer. | ||
function | getPrintGridlines() | |
function | setPrintGridlines(value) | |
Represents if cell gridlines are printed on the page. | ||
function | getPrintHeadings() | |
function | setPrintHeadings(value) | |
Represents if row and column headings are printed with this page. | ||
function | getPrintQuality() | |
function | setPrintQuality(value) | |
Represents the print quality. | ||
function | getPrintTitleColumns() | |
function | setPrintTitleColumns(value) | |
Represents the columns that contain the cells to be repeated on the left side of each page. | ||
function | getPrintTitleRows() | |
function | setPrintTitleRows(value) | |
Represents the rows that contain the cells to be repeated at the top of each page. | ||
function | getRightMargin() | |
function | setRightMargin(value) | |
Represents the size of the right margin, in unit of centimeters. | ||
function | getRightMarginInch() | |
function | setRightMarginInch(value) | |
Represents the size of the right margin, in unit of inches. | ||
function | getTopMargin() | |
function | setTopMargin(value) | |
Represents the size of the top margin, in unit of centimeters. | ||
function | getTopMarginInch() | |
function | setTopMarginInch(value) | |
Represents the size of the top margin, in unit of inches. | ||
function | getZoom() | |
function | setZoom(value) | |
Represents the scaling factor in percent. It should be between 10 and 400. |
Method Summary | ||
---|---|---|
function | clearHeaderFooter() | |
Clears header and footer setting. | ||
function | copy(source, copyOptions) | |
Copys the setting of the page setup. | ||
function | customPaperSize(width, height) | |
Sets the custom paper size, in unit of inches. | ||
function | getCommands(headerFooterScript) | |
Gets all commands of header or footer. | ||
function | getEvenFooter(section) | |
Gets a script formatting the even footer of an Excel file. | ||
function | getEvenHeader(section) | |
Gets a script formatting the even header of an Excel file. | ||
function | getFirstPageFooter(section) | |
Gets a script formatting the first page footer of an Excel file. | ||
function | getFirstPageHeader(section) | |
Gets a script formatting the first page header of an Excel file. | ||
function | getFooter(section) | |
Gets a script formatting the footer of an Excel file. | ||
function | getHeader(section) | |
Gets a script formatting the header of an Excel file. | ||
function | getPicture(isFirst, isEven, isHeader, section) | |
Gets the |
||
function | getPicture(isHeader, section) | |
Gets the |
||
function | setEvenFooter(section, footerScript) | |
Sets a script formatting the even page footer of an Excel file. Only effect in Excel 2007 when IsHFDiffOddEven is true. | ||
function | setEvenHeader(section, headerScript) | |
Sets a script formatting the even page header of an Excel file. Only effect in Excel 2007 when IsHFDiffOddEven is true. | ||
function | setFirstPageFooter(section, footerScript) | |
Sets a script formatting the first page footer of an Excel file. | ||
function | setFirstPageHeader(section, headerScript) | |
Sets a script formatting the first page header of an Excel file. Only effect in Excel 2007 when IsHFDiffFirst is true. | ||
function | setFitToPages(wide, tall) | |
Sets the number of pages the worksheet will be scaled to when it's printed. | ||
function | setFooter(section, footerScript) | |
Sets a script formatting the footer of an Excel file. | ||
function | setFooterPicture(section, footerPicture) | |
Sets an image in the footer of a worksheet. | ||
function | setHeader(section, headerScript) | |
Sets a script formatting the header of an Excel file. | ||
function | setHeaderPicture(section, headerPicture) | |
Sets an image in the header of a worksheet. | ||
function | setPicture(isFirst, isEven, isHeader, section, imageData) | |
Sets an image in the header/footer of a worksheet. |
Property Getters/Setters Detail |
---|
getPrintArea/setPrintArea : String | |
function getPrintArea() / function setPrintArea(value) |
getPrintTitleColumns/setPrintTitleColumns : String | |
function getPrintTitleColumns() / function setPrintTitleColumns(value) |
getPrintTitleRows/setPrintTitleRows : String | |
function getPrintTitleRows() / function setPrintTitleRows(value) |
getBlackAndWhite/setBlackAndWhite : boolean | |
function getBlackAndWhite() / function setBlackAndWhite(value) |
getCenterHorizontally/setCenterHorizontally : boolean | |
function getCenterHorizontally() / function setCenterHorizontally(value) |
getCenterVertically/setCenterVertically : boolean | |
function getCenterVertically() / function setCenterVertically(value) |
getPrintDraft/setPrintDraft : boolean | |
function getPrintDraft() / function setPrintDraft(value) |
getFooterMargin/setFooterMargin : Number | |
function getFooterMargin() / function setFooterMargin(value) |
getFooterMarginInch/setFooterMarginInch : Number | |
function getFooterMarginInch() / function setFooterMarginInch(value) |
getHeaderMargin/setHeaderMargin : Number | |
function getHeaderMargin() / function setHeaderMargin(value) |
getHeaderMarginInch/setHeaderMarginInch : Number | |
function getHeaderMarginInch() / function setHeaderMarginInch(value) |
getPrinterSettings/setPrinterSettings : byte[] | |
function getPrinterSettings() / function setPrinterSettings(value) |
getLeftMargin/setLeftMargin : Number | |
function getLeftMargin() / function setLeftMargin(value) |
getLeftMarginInch/setLeftMarginInch : Number | |
function getLeftMarginInch() / function setLeftMarginInch(value) |
getRightMargin/setRightMargin : Number | |
function getRightMargin() / function setRightMargin(value) |
getRightMarginInch/setRightMarginInch : Number | |
function getRightMarginInch() / function setRightMarginInch(value) |
getTopMargin/setTopMargin : Number | |
function getTopMargin() / function setTopMargin(value) |
getTopMarginInch/setTopMarginInch : Number | |
function getTopMarginInch() / function setTopMarginInch(value) |
getBottomMargin/setBottomMargin : Number | |
function getBottomMargin() / function setBottomMargin(value) |
getBottomMarginInch/setBottomMarginInch : Number | |
function getBottomMarginInch() / function setBottomMarginInch(value) |
getFirstPageNumber/setFirstPageNumber : Number | |
function getFirstPageNumber() / function setFirstPageNumber(value) |
getFitToPagesTall/setFitToPagesTall : Number | |
function getFitToPagesTall() / function setFitToPagesTall(value) |
getFitToPagesWide/setFitToPagesWide : Number | |
function getFitToPagesWide() / function setFitToPagesWide(value) |
isPercentScale/setPercentScale : boolean | |
function isPercentScale() / function setPercentScale(value) |
getOrder/setOrder : Number | |
function getOrder() / function setOrder(value) |
isAutomaticPaperSize : boolean | |
function isAutomaticPaperSize() |
getPaperSize/setPaperSize : Number | |
function getPaperSize() / function setPaperSize(value) |
getPaperWidth : Number | |
function getPaperWidth() |
getPaperHeight : Number | |
function getPaperHeight() |
getOrientation/setOrientation : Number | |
function getOrientation() / function setOrientation(value) |
getPrintComments/setPrintComments : Number | |
function getPrintComments() / function setPrintComments(value) |
getPrintErrors/setPrintErrors : Number | |
function getPrintErrors() / function setPrintErrors(value) |
getPrintHeadings/setPrintHeadings : boolean | |
function getPrintHeadings() / function setPrintHeadings(value) |
getPrintGridlines/setPrintGridlines : boolean | |
function getPrintGridlines() / function setPrintGridlines(value) |
getZoom/setZoom : Number | |
function getZoom() / function setZoom(value) |
isAutoFirstPageNumber/setAutoFirstPageNumber : boolean | |
function isAutoFirstPageNumber() / function setAutoFirstPageNumber(value) |
getPrintQuality/setPrintQuality : Number | |
function getPrintQuality() / function setPrintQuality(value) |
getPrintCopies/setPrintCopies : Number | |
function getPrintCopies() / function setPrintCopies(value) |
isHFDiffOddEven/setHFDiffOddEven : boolean | |
function isHFDiffOddEven() / function setHFDiffOddEven(value) |
isHFDiffFirst/setHFDiffFirst : boolean | |
function isHFDiffFirst() / function setHFDiffFirst(value) |
isHFScaleWithDoc/setHFScaleWithDoc : boolean | |
function isHFScaleWithDoc() / function setHFScaleWithDoc(value) |
isHFAlignMargins/setHFAlignMargins : boolean | |
function isHFAlignMargins() / function setHFAlignMargins(value) |
Method Detail |
---|
setHeaderPicture | |
function setHeaderPicture(section, headerPicture) |
section: Number
- 0:Left Section.
1:Center Section
2:Right Section
headerPicture: byte[]
- Image data.setFooterPicture | |
function setFooterPicture(section, footerPicture) |
section: Number
- 0:Left Section.
1:Center Section
2:Right Section
footerPicture: byte[]
- Image data.setPicture | |
function setPicture(isFirst, isEven, isHeader, section, imageData) |
isFirst: boolean
- Indicateds whether setting the picture of first page header/footer. isEven: boolean
- Indicateds whether setting the picture of even page header/footer.isHeader: boolean
- Indicateds whether setting the picture of header/footer.section: Number
- 0:Left Section.
1:Center Section
2:Right Section
imageData: byte[]
- Image data.getPicture | |
function getPicture(isHeader, section) |
isHeader: boolean
- Indicates whether it is in the header or footer.section: Number
- 0:Left Section.
1:Center Section
2:Right Section
getPicture | |
function getPicture(isFirst, isEven, isHeader, section) |
isFirst: boolean
- Indicateds whether getting the picture of first page header/footer. isEven: boolean
- Indicateds whether getting the picture of even page header/footer.isHeader: boolean
- Indicateds whether getting the picture of header/footer.section: Number
- 0:Left Section.
1:Center Section
2:Right Section
copy | |
function copy(source, copyOptions) |
source: PageSetup
- The source.copyOptions: CopyOptions
- The copy options.setFitToPages | |
function setFitToPages(wide, tall) |
wide: Number
- Pages wide.tall: Number
- Pages tall.customPaperSize | |
function customPaperSize(width, height) |
width: Number
- The width of the paper. height: Number
- The height of the paper.clearHeaderFooter | |
function clearHeaderFooter() |
getHeader | |
function getHeader(section) |
section: Number
- 0:Left Section.
1:Center Section
2:Right Section
getCommands | |
function getCommands(headerFooterScript) |
headerFooterScript: String
- The header/footer scriptgetFooter | |
function getFooter(section) |
section: Number
- 0:Left Section.
1:Center Section
2:Right Section
setHeader | |
function setHeader(section, 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: Number
- 0:Left Section.
1:Center Section
2:Right Section
headerScript: String
- Header format script.setFooter | |
function setFooter(section, 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: Number
- 0:Left Section.
1:Center Section
2:Right Section
footerScript: String
- Footer format script.setEvenHeader | |
function setEvenHeader(section, headerScript) |
section: Number
- 0:Left Section.
1:Center Section
2:Right Section
headerScript: String
- Header format script.getEvenHeader | |
function getEvenHeader(section) |
section: Number
- 0:Left Section.
1:Center Section
2:Right Section
setEvenFooter | |
function setEvenFooter(section, footerScript) |
section: Number
- 0:Left Section.
1:Center Section
2:Right Section
footerScript: String
- Footer format script.getEvenFooter | |
function getEvenFooter(section) |
section: Number
- 0:Left Section.
1:Center Section
2:Right Section
setFirstPageHeader | |
function setFirstPageHeader(section, headerScript) |
section: Number
- 0:Left Section.
1:Center Section
2:Right Section
headerScript: String
- Header format script.getFirstPageHeader | |
function getFirstPageHeader(section) |
section: Number
- 0:Left Section.
1:Center Section
2:Right Section
setFirstPageFooter | |
function setFirstPageFooter(section, footerScript) |
section: Number
- 0:Left Section.
1:Center Section
2:Right Section
footerScript: String
- Footer format script.getFirstPageFooter | |
function getFirstPageFooter(section) |
section: Number
- 0:Left Section.
1:Center Section
2:Right Section