[]
Represents page-level print settings.
A PageSettings object stores the page layout information used for printing
or page-based export, including paper size, margins, header and footer content,
page centering, gridline printing, draft mode, black-and-white printing, and
print error display options.
Margin and paper size values are expressed in points.
public class PageSettings
Public Class PageSettings
PageSettings pageSettings = new PageSettings();
pageSettings.TopMargin = 36d;
pageSettings.BottomMargin = 36d;
pageSettings.CenterHeader = "Sales Report";
pageSettings.CenterHorizontally = true;
| Name | Description |
|---|---|
| PageSettings() |
| Name | Description |
|---|---|
| AlignMarginsHeaderFooter | Gets or sets whether the header and footer are aligned with the margins set in the page setup options. Use this property to determine whether header and footer content follows the left and right page margins when the worksheet is printed or exported as pages. |
| BlackAndWhite | Gets or sets whether the elements of the document will be printed in black and white. Use this property to determine whether page content is configured for black-and-white printing. |
| BottomMargin | Gets or sets the size of the bottom margin, in points. This value specifies the bottom page margin used for printing or page-based export. |
| CenterFooter | Gets or sets the text displayed in the center section of the page footer. |
| CenterFooterPicture | Gets or sets the picture for the center section of the page footer. |
| CenterHeader | Gets or sets the text displayed in the center section of the page header. |
| CenterHeaderPicture | Gets or sets the picture for the center section of the page header. |
| CenterHorizontally | Gets or sets whether the sheet is centered horizontally on the page when it is printed. Use this property to determine whether the printed sheet content is centered between the left and right page margins. |
| CenterVertically | Gets or sets whether the sheet is centered vertically on the page when it is printed. |
| Draft | Gets or sets whether the sheet will be printed without graphics. When this property is |
| FooterMargin | Gets or sets the size of the footer margin, in points. This value controls the distance between the worksheet content and the footer area when the worksheet is printed. |
| HeaderMargin | Gets or sets the size of the header margin, in points. Use this property to read the current spacing reserved for the header area in these page settings. |
| LeftFooter | Gets or sets the text in the left section of the page footer. |
| LeftFooterPicture | Gets or sets the picture for the left section of the page footer. |
| LeftHeader | Gets or sets the text on the left header of the page. |
| LeftHeaderPicture | Gets or sets the picture for the left section of the page header. |
| LeftMargin | Gets or sets the size of the left margin, in points. Use this property to retrieve or update the current left page margin configured in the page settings. |
| PaperHeight | Gets or sets the height in points of the paper, considered page orientation. Use this property together with PaperWidth to determine the paper dimensions currently applied to the page. |
| PaperWidth | Gets or sets the width of the paper, in points, considered page orientation. Use this property together with PaperHeight to determine the paper dimensions currently applied to the page. |
| PrintErrors | Gets or sets the print error display option for the page. |
| PrintGridlines | Gets or sets whether cell gridlines are printed on the page. This setting applies only to worksheets. |
| RightFooter | Gets or sets the text displayed in the right section of the page footer. |
| RightFooterPicture | Gets or sets the picture for the right section of the page footer. |
| RightHeader | Gets or sets the text on the right header of the page. |
| RightHeaderPicture | Gets or sets the picture for the right section of the page header. |
| RightMargin | Gets or sets the size of the right margin, in points. This value is used for page layout when the worksheet is printed. |
| ScaleWithDocHeaderFooter | Gets or sets whether the header and footer are scaled with the document when the document size changes. Use this property to determine whether header and footer content follows the document scaling settings. |
| TopMargin | Gets or sets the size of the top margin, in points. |