[]
Represents the page setup description.
Provides access to worksheet print and pagination settings, including paper size, orientation, margins, headers and footers, print area, repeated title rows and columns, page order, and scaling options used when printing or exporting a worksheet.
Use PageSetup to obtain the page setup for a worksheet and configure its printing behavior.
public interface IPageSetup
Public Interface IPageSetup
IPageSetup pageSetup = worksheet.PageSetup;
pageSetup.Orientation = PageOrientation.Landscape;
pageSetup.PrintTitleRows = "$1:$1";
pageSetup.FitToPagesWide = 1;
pageSetup.FitToPagesTall = 0;
| Name | Description |
|---|---|
| AlignMarginsHeaderFooter | Gets or sets whether the header and footer are aligned with the margins set in the page setup options.
When this property is |
| BestFitColumns | Gets or sets whether column widths are adjusted to fit the longest text width for printing. When this property is |
| BestFitRows | Gets or sets whether row heights are adjusted to fit the tallest text height for printing.
When this property is |
| BlackAndWhite | Gets or sets whether elements of the document will be printed in black and white. |
| BottomMargin | Gets or sets the size of the bottom margin, in points. |
| CenterFooter | Gets or sets the text in the center footer section of the IPageSetup object. The string specifies the content printed in the center section of the footer. It can include header and footer codes such as page number placeholders that are supported by page setup footer text. Returns an empty string if no center footer text is set. |
| CenterFooterPicture | Returns a IGraphic object that represents the picture for the center section of the footer. Used to set attributes about the picture. |
| CenterHeader | Gets or sets the text in the center header section of the IPageSetup object. Use this property to retrieve the centered header content for the worksheet's page setup. |
| CenterHeaderPicture | Returns a IGraphic object that represents the picture for the center section of the header. Used to set attributes about the picture. |
| CenterHorizontally | Gets or sets whether the sheet is centered horizontally on the page when it's printed. This property indicates whether the worksheet content is horizontally centered within the printable page area during printing. |
| CenterVertically | Gets or sets whether the sheet is centered vertically on the page when it's printed. This property indicates whether the worksheet content is vertically centered within the printable page area during printing. |
| DifferentFirstPageHeaderFooter | Gets or sets whether a different header or footer is used on the first page. |
| Draft | Gets or sets whether the sheet will be printed without graphics. When this property returns |
| EvenPage | Returns the alignment of text on the even IPage of a workbook or section. |
| FirstPage | Returns the alignment of text on the first IPage of a workbook or section. |
| FirstPageNumber | Gets or sets the first page number that will be used when this sheet is printed. If Automatic, Document Solutions for Excel chooses the first page number. The default is Automatic. |
| FitToPagesTall | Gets or sets the number of pages tall the worksheet will be scaled to when it's printed. Applies only to worksheets. This setting is used when worksheet scaling is controlled by IsPercentScale instead of a zoom percentage. |
| FitToPagesWide | Gets or sets the number of pages wide the worksheet will be scaled to when it's printed. Applies only to worksheets. |
| FooterMargin | Gets or sets the size of the footer margin, in points. Use this property to retrieve the current distance configured for the footer margin in the page setup. |
| HeaderMargin | Gets or sets the size of the header margin, in points. Use this property to retrieve the current header margin configured in the page setup for printing. |
| IsAutoFirstPageNumber | Gets or sets whether the first page number is automatically assigned.
The default value is |
| IsPercentScale | Gets or sets whether the worksheet is scaled as a percentage.
If this property is |
| LeftFooter | Gets or sets the text in the left footer section of the IPageSetup object. The string represents the current left footer content configured in the page setup. It can include header and footer formatting codes, such as page-number placeholders or formatting instructions. |
| LeftFooterPicture | Returns a IGraphic object that represents the picture for the left section of the footer. Used to set attributes about the picture. |
| LeftHeader | Gets or sets the text in the left header section of the IPageSetup object. The string configures the left header when the worksheet is printed. It can include header text and any header codes that were set for printing. |
| LeftHeaderPicture | Returns a IGraphic object that represents the picture for the left section of the header. Used to set attributes about the picture. |
| LeftMargin | Gets or sets the size of the left margin, in points. |
| OddAndEvenPagesHeaderFooter | Gets or sets whether the specified PageSetup object has different headers and footers for odd-numbered and even-numbered pages.
When this property is |
| Order | Gets or sets a Order value that represents the order used to number pages when printing a large worksheet. This property determines whether pages are numbered down the rows before moving across columns, or across columns before moving down the rows. |
| Orientation | Gets or sets a PageOrientation value that represents the portrait or landscape printing mode. Use this property to retrieve the current page orientation configured for the worksheet's page setup. |
| PaperHeight | Returns the height in inches of the paper, considering page orientation. If a custom paper size is set by CustomPaperSize(double, double), this property returns the configured paper height. |
| PaperSize | Gets or sets the size of the paper. |
| PaperWidth | Returns the width in inches of the paper, considered page orientation. If a custom paper size is set by CustomPaperSize(double, double), this property returns the configured paper width. |
| PrintArea | Gets or sets the range to be printed, as a string using A1-style references in the language of the macro. If the print area is not specified, the used range of the worksheet is printed by default. |
| PrintComments | Gets or sets the way comments are printed with the sheet. Use this property to determine whether comments are not printed, printed as end notes, or printed in place on the worksheet. If the page setup has not been initialized, this property returns NoComments. |
| PrintCopies | Gets or sets the number of copies to print.
Returns the print copies setting for the worksheet page setup. If no page setup
has been created, this property returns |
| PrintErrors | Gets or sets a PrintErrors constant specifying how cell error values are displayed when the worksheet is printed. This setting can be used to suppress the display of error values during printing, for example by showing blanks, dashes, or |
| PrintGridlines | Gets or sets whether cell gridlines are printed on the page. Applies only to worksheets. Use this property to determine whether worksheet gridlines are included in printed output. |
| PrintHeadings | Gets or sets whether row and column headings are printed with this page. Applies only to worksheets. |
| PrintNotes | Gets or sets whether cell notes are printed as end notes with the sheet. Applies only to worksheets. |
| PrintPageRange | Gets or sets the range of pages to print, where page numbers or page ranges are separated by commas and counted from the beginning of the document. Use this property to retrieve the page-range string that controls which pages are included in the print operation. For example, |
| PrintQuality | Gets or sets a PrintQuality value that represents the print quality of this page. Default is 600 dpi. Use this property to determine the current page print resolution that will be applied when the worksheet is printed. |
| PrintTailColumns | Gets or sets the columns that contain the cells to be repeated on the right side of each page, as a string in A1-style notation in the language of the macro. Use this property to read the current right-side repeating column setting for the worksheet page setup. |
| PrintTailRows | Gets or sets the rows that contain the cells to be repeated on the bottom of each page, as a string in A1-style notation in the language of the macro. Use this property to retrieve the bottom repeating rows configured for the worksheet page setup. |
| PrintTitleColumns | Gets or sets the columns that contain the cells to be repeated on the left side of each page, as a string in A1-style notation in the language of the macro. |
| PrintTitleRows | Gets or sets the rows that contain the cells to be repeated at the top of each page, as a string in A1-style notation in the language of the macro. Use this property to retrieve the current repeating row setting for the worksheet page setup. |
| RightFooter | Gets or sets the text in the right footer section of the IPageSetup object. The string represents the footer content configured for the right section of the page footer, including any supported header or footer formatting codes. |
| RightFooterPicture | Returns a IGraphic object that represents the picture for the right section of the footer. Used to set attributes of the picture. |
| RightHeader | Gets or sets the text in the right header section of the IPageSetup object. Use this property to configure the text displayed in the right section of the page header. Returns an empty string if the right header is not set. |
| RightHeaderPicture | Returns a IGraphic object that represents the picture for the right section of the header. Used to set attributes of the picture. |
| RightMargin | Gets or sets the size of the right margin, in points. |
| ScaleWithDocHeaderFooter | Gets or sets whether the header and footer are scaled with the document when the document size changes. This setting affects whether header and footer content follows the document scaling applied during printing. |
| TopMargin | Gets or sets the size of the top margin, in points. |
| Zoom | Gets or sets a Variant value that represents a percentage (between 10 and 400 percent) by which Document Solutions for Excel will scale the worksheet for printing. This property is used when the worksheet is scaled as a percentage. If IsPercentScale returns |
| Name | Description |
|---|---|
| CustomPaperSize(double, double) | Sets the custom paper size, in unit of inches. This method applies a user-defined paper size for the page setup. After calling this method, PaperWidth and PaperHeight return the specified custom dimensions. |
| FromJson(string) | Generates the page setup from the specified JSON string. Use this method to apply page setup settings from serialized JSON data, such as JSON produced by ToJson(). |
| ToJson() | Generates a JSON string from the page setup. Use this method to serialize the current page setup settings to JSON so that they can be stored or later applied by using FromJson(string). |