PageSetup Class
Encapsulates the object that represents the page setup description. The PageSetup object contains all page setup options.
Inheritance Hierarchy
SystemObject
  Aspose.CellsPageSetup

Namespace: Aspose.Cells
Assembly: Aspose.Cells (in Aspose.Cells.dll) Version: 19.10.0.0 (19.10)
Syntax
public class PageSetup

The PageSetup type exposes the following members.

Properties
  NameDescription
Public propertyBlackAndWhite
Represents if elements of the document will be printed in black and white.
Public propertyBottomMargin
Represents the size of the bottom margin, in unit of centimeters.
Public propertyBottomMarginInch
Represents the size of the bottom margin, in unit of inches.
Public propertyCenterHorizontally
Represent if the sheet is printed centered horizontally.
Public propertyCenterVertically
Represent if the sheet is printed centered vertically.
Public propertyFirstPageNumber
Represents the first page number that will be used when this sheet is printed.
Public propertyFitToPagesTall
Represents the number of pages tall the worksheet will be scaled to when it's printed. The default value is 1.
Public propertyFitToPagesWide
Represents the number of pages wide the worksheet will be scaled to when it's printed. The default value is 1.
Public propertyFooterMargin
Represents the distance from the bottom of the page to the footer, in unit of centimeters.
Public propertyFooterMarginInch
Represents the distance from the bottom of the page to the footer, in unit of inches.
Public propertyHeaderMargin
Represents the distance from the top of the page to the header, in unit of centimeters.
Public propertyHeaderMarginInch
Represents the distance from the top of the page to the header, in unit of inches.
Public propertyIsAutoFirstPageNumber
Indicates whether the first the page number is automatically assigned.
Public propertyIsAutomaticPaperSize
Indicates whether the paper size is automatic.
Public propertyIsHFAlignMargins
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.
Public propertyIsHFDiffFirst
True means that the header/footer of the first page is different with other pages.
Public propertyIsHFDiffOddEven
True means that the header/footer of the odd pages is different with odd pages.
Public propertyIsHFScaleWithDoc
Indicates whether header and footer are scaled with document scaling. Only applies for Excel 2007.
Public propertyIsPercentScale
If this property is False, the FitToPagesWide and FitToPagesTall properties control how the worksheet is scaled.
Public propertyLeftMargin
Represents the size of the left margin, in unit of centimeters.
Public propertyLeftMarginInch
Represents the size of the left margin, in unit of inches.
Public propertyODSPageBackground
Gets the background of ODS.
Public propertyOrder
Represents the order that Microsoft Excel uses to number pages when printing a large worksheet.
Public propertyOrientation
Represents page print orientation.
Public propertyPaperHeight
Represents the height in inches of the paper, considered page orientation.
Public propertyPaperSize
Represents the size of the paper.
Public propertyPaperWidth
Represents the width in inches of the paper, considered page orientation.
Public propertyPrintArea
Represents the range to be printed.
Public propertyPrintComments
Represents the way comments are printed with the sheet.
Public propertyPrintCopies
Get and sets number of copies to print.
Public propertyPrintDraft
Represents if the sheet will be printed without graphics.
Public propertyPrintErrors
Specifies the type of print error displayed.
Public propertyPrinterSettings
Gets and sets the settings of the default printer.
Public propertyPrintGridlines
Represents if cell gridlines are printed on the page.
Public propertyPrintHeadings
Represents if row and column headings are printed with this page.
Public propertyPrintQuality
Represents the print quality.
Public propertyCode examplePrintTitleColumns
Represents the columns that contain the cells to be repeated on the left side of each page.
Public propertyCode examplePrintTitleRows
Represents the rows that contain the cells to be repeated at the top of each page.
Public propertyRightMargin
Represents the size of the right margin, in unit of centimeters.
Public propertyRightMarginInch
Represents the size of the right margin, in unit of inches.
Public propertyTopMargin
Represents the size of the top margin, in unit of centimeters.
Public propertyTopMarginInch
Represents the size of the top margin, in unit of inches.
Public propertyZoom
Represents the scaling factor in percent. It should be between 10 and 400.
Methods
  NameDescription
Public methodClearHeaderFooter
Clears header and footer setting.
Public methodCopy
Copys the setting of the page setup.
Public methodCustomPaperSize
Sets the custom paper size, in unit of inches.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetCommands
Gets all commands of header or footer.
Public methodGetEvenFooter
Gets a script formatting the even footer of an Excel file.
Public methodGetEvenHeader
Gets a script formatting the even header of an Excel file.
Public methodGetFirstPageFooter
Gets a script formatting the first page footer of an Excel file.
Public methodGetFirstPageHeader
Gets a script formatting the first page header of an Excel file.
Public methodGetFooter
Gets a script formatting the footer of an Excel file.
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetHeader
Gets a script formatting the header of an Excel file.
Public methodGetPicture(Boolean, Int32)
Gets the Picture object of the header / footer.
Public methodGetPicture(Boolean, Boolean, Boolean, Int32)
Gets the Picture object of the header / footer.
Public methodGetType
Gets the type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodSetEvenFooter
Sets a script formatting the even page footer of an Excel file. Only effect in Excel 2007 when IsHFDiffOddEven is true.
Public methodSetEvenHeader
Sets a script formatting the even page header of an Excel file. Only effect in Excel 2007 when IsHFDiffOddEven is true.
Public methodSetFirstPageFooter
Sets a script formatting the first page footer of an Excel file.
Public methodSetFirstPageHeader
Sets a script formatting the first page header of an Excel file. Only effect in Excel 2007 when IsHFDiffFirst is true.
Public methodSetFitToPages
Sets the number of pages the worksheet will be scaled to when it's printed.
Public methodSetFooter
Sets a script formatting the footer of an Excel file.
Public methodSetFooterPicture
Sets an image in the footer of a worksheet.
Public methodSetHeader
Sets a script formatting the header of an Excel file.
Public methodSetHeaderPicture
Sets an image in the header of a worksheet.
Public methodSetPicture
Sets an image in the header/footer of a worksheet.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Examples
[C#]
sheet.PageSetup.PrintArea = "D1:K13";
sheet.PageSetup.PrintTitleRows = "$5:$7";
sheet.PageSetup.PrintTitleColumns = "$A:$B";

[Visual Basic]
sheet.PageSetup.PrintArea = "D1:K13"
sheet.PageSetup.PrintTitleRows = "$5:$7"
sheet.PageSetup.PrintTitleColumns = "$A:$B"
See Also