Aspose::Cells::PageSetup class
Contents
[
Hide
]PageSetup class
Encapsulates the object that represents the page setup description. The PageSetup object contains all page setup options.
class PageSetup
Methods
Method | Description |
---|---|
ClearHeaderFooter() | Clears header and footer setting. |
Copy(const PageSetup& source, const CopyOptions& copyOptions) | Copies the setting of the page setup. |
CustomPaperSize(double width, double height) | Sets the custom paper size, in unit of inches. |
GetBlackAndWhite() | Represents if elements of the document will be printed in black and white. |
GetBottomMargin() | Represents the size of the bottom margin, in unit of centimeters. |
GetBottomMarginInch() | Represents the size of the bottom margin, in unit of inches. |
GetCenterHorizontally() | Represent if the sheet is printed centered horizontally. |
GetCenterVertically() | Represent if the sheet is printed centered vertically. |
GetCommands(const U16String& headerFooterScript) | Gets all commands of header or footer. |
GetCommands(const char16_t* headerFooterScript) | Gets all commands of header or footer. |
GetEvenFooter(int32_t section) | Gets a script formatting the even footer of an Excel file. |
GetEvenHeader(int32_t section) | Gets a script formatting the even header of an Excel file. |
GetFirstPageFooter(int32_t section) | Gets a script formatting the first page footer of an Excel file. |
GetFirstPageHeader(int32_t section) | Gets a script formatting the first page header of an Excel file. |
GetFirstPageNumber() | Represents the first page number that will be used when this sheet is printed. |
GetFitToPagesTall() | Represents the number of pages tall the worksheet will be scaled to when it’s printed. The default value is 1. |
GetFitToPagesWide() | Represents the number of pages wide the worksheet will be scaled to when it’s printed. The default value is 1. |
GetFooter(int32_t section) | Gets a script formatting the footer of an Excel file. |
GetFooterMargin() | Represents the distance from the bottom of the page to the footer, in unit of centimeters. |
GetFooterMarginInch() | Represents the distance from the bottom of the page to the footer, in unit of inches. |
GetHeader(int32_t section) | Gets a script formatting the header of an Excel file. |
GetHeaderMargin() | Represents the distance from the top of the page to the header, in unit of centimeters. |
GetHeaderMarginInch() | Represents the distance from the top of the page to the header, in unit of inches. |
GetLeftMargin() | Represents the size of the left margin, in unit of centimeters. |
GetLeftMarginInch() | Represents the size of the left margin, in unit of inches. |
GetODSPageBackground() | Gets the background of ODS. |
GetOrder() | Represents the order that Microsoft Excel uses to number pages when printing a large worksheet. |
GetOrientation() | Represents page print orientation. |
GetPaperHeight() | Gets the height of the paper in unit of inches , considered page orientation. |
GetPaperSize() | Represents the size of the paper. |
GetPaperWidth() | Gets the width of the paper in unit of inches, considered page orientation. |
GetPicture(bool isHeader, int32_t section) | Gets the Picture object of the header / footer. |
GetPicture(bool isFirst, bool isEven, bool isHeader, int32_t section) | Gets the Picture object of the header / footer. |
GetPrintArea() | Represents the range to be printed. |
GetPrintComments() | Represents the way comments are printed with the sheet. |
GetPrintCopies() | Get and sets number of copies to print. |
GetPrintDraft() | Represents if the sheet will be printed without graphics. |
GetPrintErrors() | Specifies the type of print error displayed. |
GetPrinterSettings() | Gets and sets the settings of the default printer. |
GetPrintGridlines() | Represents if cell gridlines are printed on the page. |
GetPrintHeadings() | Represents if row and column headings are printed with this page. |
GetPrintQuality() | Represents the print quality. |
GetPrintTitleColumns() | Represents the columns that contain the cells to be repeated on the left side of each page. |
GetPrintTitleRows() | Represents the rows that contain the cells to be repeated at the top of each page. |
GetRightMargin() | Represents the size of the right margin, in unit of centimeters. |
GetRightMarginInch() | Represents the size of the right margin, in unit of inches. |
GetTopMargin() | Represents the size of the top margin, in unit of centimeters. |
GetTopMarginInch() | Represents the size of the top margin, in unit of inches. |
GetZoom() | Represents the scaling factor in percent. It should be between 10 and 400. |
IsAutoFirstPageNumber() | Indicates whether the first the page number is automatically assigned. |
IsAutomaticPaperSize() | Indicates whether the paper size is automatic. |
IsHFAlignMargins() | 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. |
IsHFDiffFirst() | True means that the header/footer of the first page is different with other pages. |
IsHFDiffOddEven() | True means that the header/footer of the odd pages is different with odd pages. |
IsHFScaleWithDoc() | Indicates whether header and footer are scaled with document scaling. Only applies for Excel 2007. |
IsNull() const | Checks whether the implementation object is nullptr. |
IsPercentScale() | If this property is False, the FitToPagesWide and FitToPagesTall properties control how the worksheet is scaled. |
explicit operator bool() const | operator bool() |
operator=(const PageSetup& src) | operator= |
PageSetup(PageSetup_Impl* impl) | Constructs from an implementation object. |
PageSetup(const PageSetup& src) | Copy constructor. |
SetBlackAndWhite(bool value) | Represents if elements of the document will be printed in black and white. |
SetBottomMargin(double value) | Represents the size of the bottom margin, in unit of centimeters. |
SetBottomMarginInch(double value) | Represents the size of the bottom margin, in unit of inches. |
SetCenterHorizontally(bool value) | Represent if the sheet is printed centered horizontally. |
SetCenterVertically(bool value) | Represent if the sheet is printed centered vertically. |
SetEvenFooter(int32_t section, const U16String& footerScript) | Sets a script formatting the even page footer of an Excel file. Only effect in Excel 2007 when IsHFDiffOddEven is true. |
SetEvenFooter(int32_t section, const char16_t* footerScript) | Sets a script formatting the even page footer of an Excel file. Only effect in Excel 2007 when IsHFDiffOddEven is true. |
SetEvenHeader(int32_t section, const U16String& headerScript) | Sets a script formatting the even page header of an Excel file. Only effect in Excel 2007 when IsHFDiffOddEven is true. |
SetEvenHeader(int32_t section, const char16_t* headerScript) | Sets a script formatting the even page header of an Excel file. Only effect in Excel 2007 when IsHFDiffOddEven is true. |
SetFirstPageFooter(int32_t section, const U16String& footerScript) | Sets a script formatting the first page footer of an Excel file. |
SetFirstPageFooter(int32_t section, const char16_t* footerScript) | Sets a script formatting the first page footer of an Excel file. |
SetFirstPageHeader(int32_t section, const U16String& headerScript) | Sets a script formatting the first page header of an Excel file. Only effect in Excel 2007 when IsHFDiffFirst is true. |
SetFirstPageHeader(int32_t section, const char16_t* headerScript) | Sets a script formatting the first page header of an Excel file. Only effect in Excel 2007 when IsHFDiffFirst is true. |
SetFirstPageNumber(int32_t value) | Represents the first page number that will be used when this sheet is printed. |
SetFitToPages(int32_t wide, int32_t tall) | Sets the number of pages the worksheet will be scaled to when it’s printed. |
SetFitToPagesTall(int32_t value) | Represents the number of pages tall the worksheet will be scaled to when it’s printed. The default value is 1. |
SetFitToPagesWide(int32_t value) | Represents the number of pages wide the worksheet will be scaled to when it’s printed. The default value is 1. |
SetFooter(int32_t section, const U16String& footerScript) | Sets a script formatting the footer of an Excel file. |
SetFooter(int32_t section, const char16_t* footerScript) | Sets a script formatting the footer of an Excel file. |
SetFooterMargin(double value) | Represents the distance from the bottom of the page to the footer, in unit of centimeters. |
SetFooterMarginInch(double value) | Represents the distance from the bottom of the page to the footer, in unit of inches. |
SetFooterPicture(int32_t section, const Vector <uint8_t>& footerPicture) | Sets an image in the footer of a worksheet. |
SetHeader(int32_t section, const U16String& headerScript) | Sets a script formatting the header of an Excel file. |
SetHeader(int32_t section, const char16_t* headerScript) | Sets a script formatting the header of an Excel file. |
SetHeaderMargin(double value) | Represents the distance from the top of the page to the header, in unit of centimeters. |
SetHeaderMarginInch(double value) | Represents the distance from the top of the page to the header, in unit of inches. |
SetHeaderPicture(int32_t section, const Vector <uint8_t>& headerPicture) | Sets an image in the header of a worksheet. |
SetIsAutoFirstPageNumber(bool value) | Indicates whether the first the page number is automatically assigned. |
SetIsHFAlignMargins(bool 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. |
SetIsHFDiffFirst(bool value) | True means that the header/footer of the first page is different with other pages. |
SetIsHFDiffOddEven(bool value) | True means that the header/footer of the odd pages is different with odd pages. |
SetIsHFScaleWithDoc(bool value) | Indicates whether header and footer are scaled with document scaling. Only applies for Excel 2007. |
SetIsPercentScale(bool value) | If this property is False, the FitToPagesWide and FitToPagesTall properties control how the worksheet is scaled. |
SetLeftMargin(double value) | Represents the size of the left margin, in unit of centimeters. |
SetLeftMarginInch(double value) | Represents the size of the left margin, in unit of inches. |
SetOrder(PrintOrderType value) | Represents the order that Microsoft Excel uses to number pages when printing a large worksheet. |
SetOrientation(PageOrientationType value) | Represents page print orientation. |
SetPaperSize(PaperSizeType value) | Represents the size of the paper. |
SetPicture(bool isFirst, bool isEven, bool isHeader, int32_t section, const Vector <uint8_t>& imageData) | Sets an image in the header/footer of a worksheet. |
SetPrintArea(const U16String& value) | Represents the range to be printed. |
SetPrintArea(const char16_t* value) | Represents the range to be printed. |
SetPrintComments(PrintCommentsType value) | Represents the way comments are printed with the sheet. |
SetPrintCopies(int32_t value) | Get and sets number of copies to print. |
SetPrintDraft(bool value) | Represents if the sheet will be printed without graphics. |
SetPrintErrors(PrintErrorsType value) | Specifies the type of print error displayed. |
SetPrinterSettings(const Vector <uint8_t>& value) | Gets and sets the settings of the default printer. |
SetPrintGridlines(bool value) | Represents if cell gridlines are printed on the page. |
SetPrintHeadings(bool value) | Represents if row and column headings are printed with this page. |
SetPrintQuality(int32_t value) | Represents the print quality. |
SetPrintTitleColumns(const U16String& value) | Represents the columns that contain the cells to be repeated on the left side of each page. |
SetPrintTitleColumns(const char16_t* value) | Represents the columns that contain the cells to be repeated on the left side of each page. |
SetPrintTitleRows(const U16String& value) | Represents the rows that contain the cells to be repeated at the top of each page. |
SetPrintTitleRows(const char16_t* value) | Represents the rows that contain the cells to be repeated at the top of each page. |
SetRightMargin(double value) | Represents the size of the right margin, in unit of centimeters. |
SetRightMarginInch(double value) | Represents the size of the right margin, in unit of inches. |
SetTopMargin(double value) | Represents the size of the top margin, in unit of centimeters. |
SetTopMarginInch(double value) | Represents the size of the top margin, in unit of inches. |
SetZoom(int32_t value) | Represents the scaling factor in percent. It should be between 10 and 400. |
~PageSetup() | Destructor. |
Fields
Field | Description |
---|---|
_impl | The implementation object. |
Examples
Aspose::Cells::Startup();
Workbook workbook;
WorksheetCollection sheets = workbook.GetWorksheets();
//Add a worksheet
sheets.Add();
Worksheet sheet = sheets.Get(1);
PageSetup pageSetup = sheet.GetPageSetup();
pageSetup.SetPrintArea(u"D1:K13");
Aspose::Cells::Cleanup();
See Also
- Namespace Aspose::Cells
- Library Aspose.Cells for C++