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. 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. | ||
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 | getODSPageBackground() | |
Gets the background of ODS.
|
||
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() | |
Gets the height of the paper in unit of inches , 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() | |
Gets the width of the paper in unit of inches, 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) | |
Copies 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.
|
function getODSPageBackground()
function getPrintArea() / function setPrintArea(value)
function getPrintTitleColumns() / function setPrintTitleColumns(value)
function getPrintTitleRows() / function setPrintTitleRows(value)
function getBlackAndWhite() / function setBlackAndWhite(value)
function getCenterHorizontally() / function setCenterHorizontally(value)
function getCenterVertically() / function setCenterVertically(value)
function getPrintDraft() / function setPrintDraft(value)
function getFooterMargin() / function setFooterMargin(value)
function getFooterMarginInch() / function setFooterMarginInch(value)
function getHeaderMargin() / function setHeaderMargin(value)
function getHeaderMarginInch() / function setHeaderMarginInch(value)
function getPrinterSettings() / function setPrinterSettings(value)
function getLeftMargin() / function setLeftMargin(value)
function getLeftMarginInch() / function setLeftMarginInch(value)
function getRightMargin() / function setRightMargin(value)
function getRightMarginInch() / function setRightMarginInch(value)
function getTopMargin() / function setTopMargin(value)
function getTopMarginInch() / function setTopMarginInch(value)
function getBottomMargin() / function setBottomMargin(value)
function getBottomMarginInch() / function setBottomMarginInch(value)
function getFirstPageNumber() / function setFirstPageNumber(value)
function getFitToPagesTall() / function setFitToPagesTall(value)
function getFitToPagesWide() / function setFitToPagesWide(value)
function isPercentScale() / function setPercentScale(value)
function getOrder() / function setOrder(value)
function isAutomaticPaperSize()
function getPaperSize() / function setPaperSize(value)
function getPaperWidth()
function getPaperHeight()
function getOrientation() / function setOrientation(value)
function getPrintComments() / function setPrintComments(value)
function getPrintErrors() / function setPrintErrors(value)
function getPrintHeadings() / function setPrintHeadings(value)
function getPrintGridlines() / function setPrintGridlines(value)
function getZoom() / function setZoom(value)
function isAutoFirstPageNumber() / function setAutoFirstPageNumber(value)
function getPrintQuality() / function setPrintQuality(value)
function getPrintCopies() / function setPrintCopies(value)
function isHFDiffOddEven() / function setHFDiffOddEven(value)
function isHFDiffFirst() / function setHFDiffFirst(value)
function isHFScaleWithDoc() / function setHFScaleWithDoc(value)
function isHFAlignMargins() / function setHFAlignMargins(value)
function setHeaderPicture(section, headerPicture)
section: Number
- 0:Left Section.
1:Center Section
2:Right Section
headerPicture: byte[]
- Image data.function setFooterPicture(section, footerPicture)
section: Number
- 0:Left Section.
1:Center Section
2:Right Section
footerPicture: byte[]
- Image data.function setPicture(isFirst, isEven, isHeader, section, imageData)
isFirst: boolean
- Indicates whether setting the picture of first page header/footer. isEven: boolean
- Indicates whether setting the picture of even page header/footer.isHeader: boolean
- Indicates whether setting the picture of header/footer.section: Number
- 0:Left Section.
1:Center Section
2:Right Section
imageData: byte[]
- Image data.function getPicture(isHeader, section)
function getPicture(isFirst, isEven, isHeader, section)
isFirst: boolean
- Indicates whether getting the picture of first page header/footer. isEven: boolean
- Indicates whether getting the picture of even page header/footer.isHeader: boolean
- Indicates whether getting the picture of header/footer.section: Number
- 0:Left Section.
1:Center Section
2:Right Section
function copy(source, copyOptions)
source: PageSetup
- The source.copyOptions: CopyOptions
- The copy options.function setFitToPages(wide, tall)
wide: Number
- Pages wide.tall: Number
- Pages tall.function customPaperSize(width, height)
width: Number
- The width of the paper. height: Number
- The height of the paper.function clearHeaderFooter()
function getHeader(section)
section: Number
- 0:Left Section.
1:Center Section
2:Right Section
function getCommands(headerFooterScript)
headerFooterScript: String
- The header/footer scriptfunction getFooter(section)
section: Number
- 0:Left Section.
1:Center Section
2:Right Section
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 example: &"Arial" |
&"<FontName>, <FontStyle>" | Font name and font style, for example: &"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 example(RED): &FF0000 |
&G | Image script |
section: Number
- 0:Left Section.
1:Center Section
2:Right Section
headerScript: String
- Header format script.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 example: &"Arial" |
&"<FontName>, <FontStyle>" | Font name and font style, for example: &"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.function setEvenHeader(section, headerScript)
section: Number
- 0:Left Section.
1:Center Section
2:Right Section
headerScript: String
- Header format script.function getEvenHeader(section)
section: Number
- 0:Left Section.
1:Center Section
2:Right Section
function setEvenFooter(section, footerScript)
section: Number
- 0:Left Section.
1:Center Section
2:Right Section
footerScript: String
- Footer format script.function getEvenFooter(section)
section: Number
- 0:Left Section.
1:Center Section
2:Right Section
function setFirstPageHeader(section, headerScript)
section: Number
- 0:Left Section.
1:Center Section
2:Right Section
headerScript: String
- Header format script.function getFirstPageHeader(section)
section: Number
- 0:Left Section.
1:Center Section
2:Right Section
function setFirstPageFooter(section, footerScript)
section: Number
- 0:Left Section.
1:Center Section
2:Right Section
footerScript: String
- Footer format script.function getFirstPageFooter(section)
section: Number
- 0:Left Section.
1:Center Section
2:Right Section