ApiPageSetup
Class representing the page setup (print layout) of a worksheet.
Properties
| Name | Type | Description |
|---|---|---|
| AlignMarginsHeaderFooter | boolean | Returns or sets whether the header and footer margins are aligned with the page margins. |
| BottomMargin | number | Returns or sets the bottom margin size measured in millimeters. |
| CenterFooter | string | Returns or sets the center part of the (odd) footer. |
| CenterHeader | string | Returns or sets the center part of the (odd) header. |
| CenterHorizontally | boolean | Returns or sets whether the worksheet is centered horizontally on the page when printed. |
| CenterVertically | boolean | Returns or sets whether the worksheet is centered vertically on the page when printed. |
| DifferentFirstPageHeaderFooter | boolean | Returns or sets whether a different header and footer is used on the first printed page. |
| EvenPage | ApiPage | Returns the header and footer of the even pages. |
| FirstPage | ApiPage | Returns the header and footer of the first page. |
| FirstPageNumber | number | null | Returns or sets the first page number (null means automatic). |
| FitToPagesTall | number | Returns or sets the number of pages tall the worksheet is scaled to when printed (0 means automatic). |
| FitToPagesWide | number | Returns or sets the number of pages wide the worksheet is scaled to when printed (0 means automatic). |
| FooterMargin | number | Returns or sets the distance from the bottom of the page to the footer, in millimeters. |
| HeaderMargin | number | Returns or sets the distance from the top of the page to the header, in millimeters. |
| LeftFooter | string | Returns or sets the left part of the (odd) footer. |
| LeftHeader | string | Returns or sets the left part of the (odd) header. |
| LeftMargin | number | Returns or sets the left margin size measured in millimeters. |
| OddAndEvenPagesHeaderFooter | boolean | Returns or sets whether different headers and footers are used on odd and even printed pages. |
| Orientation | PageOrientation | Returns or sets the page orientation. |
| PaperSize | PaperSize | Returns or sets the paper size. |
| Parent | ApiWorksheet | Returns the parent worksheet of the page setup. |
| PrintArea | string | Returns or sets the range to be printed (empty string prints the whole sheet). |
| PrintGridlines | boolean | Returns or sets whether the cell gridlines are printed. |
| PrintHeadings | boolean | Returns or sets whether the row and column headings are printed. |
| PrintTitleColumns | string | Returns or sets the columns repeated at the left of each printed page. |
| PrintTitleRows | string | Returns or sets the rows repeated at the top of each printed page. |
| RightFooter | string | Returns or sets the right part of the (odd) footer. |
| RightHeader | string | Returns or sets the right part of the (odd) header. |
| RightMargin | number | Returns or sets the right margin size measured in millimeters. |
| ScaleWithDocHeaderFooter | boolean | Returns or sets whether the header and footer are scaled with the document when printing. |
| TopMargin | number | Returns or sets the top margin size measured in millimeters. |
| Zoom | number | Returns or sets the print scaling factor in percent (10-400). |
Methods
The following table lists the available methods.
| Method | Returns | Description |
|---|---|---|
| GetAlignMarginsHeaderFooter | boolean | Returns whether the header and footer margins are aligned with the page margins. |
| GetBottomMargin | number | Returns the size of the bottom margin. |
| GetCenterFooter | string | Returns the center part of the footer used when the worksheet is printed. |
| GetCenterHeader | string | Returns the center part of the header used when the worksheet is printed. |
| GetCenterHorizontally | boolean | Returns whether the worksheet is centered horizontally on the page when printed. |
| GetCenterVertically | boolean | Returns whether the worksheet is centered vertically on the page when printed. |
| GetDifferentFirstPageHeaderFooter | boolean | Returns whether a different header and footer is used on the first printed page. |
| GetEvenPage | ApiPage | Returns the header and footer of the even pages of the worksheet. The returned object is meaningful when ApiPageSetup#GetOddAndEvenPagesHeaderFooter is enabled. |
| GetFirstPage | ApiPage | Returns the header and footer of the first page of the worksheet. The returned object is meaningful when ApiPageSetup#GetDifferentFirstPageHeaderFooter is enabled. |
| GetFirstPageNumber | number | null | Returns the first page number used when the worksheet is printed. Returns null when the page numbering is automatic. |
| GetFitToPagesTall | number | Returns the number of pages tall the worksheet is scaled to when printed (0 means automatic). |
| GetFitToPagesWide | number | Returns the number of pages wide the worksheet is scaled to when printed (0 means automatic). |
| GetFooterMargin | number | Returns the distance from the bottom of the page to the footer. |
| GetHeaderMargin | number | Returns the distance from the top of the page to the header. |
| GetLeftFooter | string | Returns the left part of the footer used when the worksheet is printed. |
| GetLeftHeader | string | Returns the left part of the header used when the worksheet is printed. |
| GetLeftMargin | number | Returns the size of the left margin. |
| GetOddAndEvenPagesHeaderFooter | boolean | Returns whether different headers and footers are used on odd and even printed pages. |
| GetOrientation | PageOrientation | Returns the page orientation used when the worksheet is printed. |
| GetPaperSize | PaperSize | Returns the paper size used when the worksheet is printed. |
| GetParent | ApiWorksheet | Returns the worksheet that owns this page setup. |
| GetPrintArea | string | Returns the range to be printed (the print area) as a string, or an empty string when the whole sheet is printed. |
| GetPrintGridlines | boolean | Returns whether cell gridlines are printed with the worksheet. |
| GetPrintHeadings | boolean | Returns whether row and column headings are printed with the worksheet. |
| GetPrintTitleColumns | string | Returns the columns that are repeated at the left of each printed page, or an empty string if none. |
| GetPrintTitleRows | string | Returns the rows that are repeated at the top of each printed page, or an empty string if none. |
| GetRightFooter | string | Returns the right part of the footer used when the worksheet is printed. |
| GetRightHeader | string | Returns the right part of the header used when the worksheet is printed. |
| GetRightMargin | number | Returns the size of the right margin. |
| GetScaleWithDocHeaderFooter | boolean | Returns whether the header and footer are scaled with the document when it is scaled for printing. |
| GetTopMargin | number | Returns the size of the top margin. |
| GetZoom | number | Returns the scaling factor (in percent) used when the worksheet is printed. |
| SetAlignMarginsHeaderFooter | boolean | Sets whether the header and footer margins are aligned with the page margins. |
| SetBottomMargin | boolean | Sets the size of the bottom margin. |
| SetCenterFooter | boolean | Sets the center part of the footer used when the worksheet is printed. |
| SetCenterHeader | boolean | Sets the center part of the header used when the worksheet is printed. |
| SetCenterHorizontally | boolean | Sets whether the worksheet is centered horizontally on the page when printed. |
| SetCenterVertically | boolean | Sets whether the worksheet is centered vertically on the page when printed. |
| SetDifferentFirstPageHeaderFooter | boolean | Sets whether a different header and footer is used on the first printed page. |
| SetFirstPageNumber | boolean | Sets the first page number used when the worksheet is printed. |
| SetFitToPagesTall | boolean | Sets the number of pages tall the worksheet is scaled to when printed (0 means automatic). Setting this property turns on the "fit to page" mode. |
| SetFitToPagesWide | boolean | Sets the number of pages wide the worksheet is scaled to when printed (0 means automatic). Setting this property turns on the "fit to page" mode. |
| SetFooterMargin | boolean | Sets the distance from the bottom of the page to the footer. |
| SetHeaderMargin | boolean | Sets the distance from the top of the page to the header. |
| SetLeftFooter | boolean | Sets the left part of the footer used when the worksheet is printed. |
| SetLeftHeader | boolean | Sets the left part of the header used when the worksheet is printed. |
| SetLeftMargin | boolean | Sets the size of the left margin. |
| SetOddAndEvenPagesHeaderFooter | boolean | Sets whether different headers and footers are used on odd and even printed pages. |
| SetOrientation | boolean | Sets the page orientation used when the worksheet is printed. |
| SetPaperSize | boolean | Sets the paper size used when the worksheet is printed. |
| SetPrintArea | boolean | Sets the range to be printed (the print area). Pass an empty string to clear it and print the whole sheet. |
| SetPrintGridlines | boolean | Sets whether cell gridlines are printed with the worksheet. |
| SetPrintHeadings | boolean | Sets whether row and column headings are printed with the worksheet. |
| SetPrintTitleColumns | boolean | Sets the columns that are repeated at the left of each printed page. Pass an empty string to clear them. |
| SetPrintTitleRows | boolean | Sets the rows that are repeated at the top of each printed page. Pass an empty string to clear them. |
| SetRightFooter | boolean | Sets the right part of the footer used when the worksheet is printed. |
| SetRightHeader | boolean | Sets the right part of the header used when the worksheet is printed. |
| SetRightMargin | boolean | Sets the size of the right margin. |
| SetScaleWithDocHeaderFooter | boolean | Sets whether the header and footer are scaled with the document when it is scaled for printing. |
| SetTopMargin | boolean | Sets the size of the top margin. |
| SetZoom | boolean | Sets the scaling factor (in percent) used when the worksheet is printed. Setting this property turns off the "fit to page" mode. |