Page Setup Features with Golang via C++
Page Setup Features
Aspose.Cells provides a comprehensive set of features to configure page setup options for Excel files. These features allow you to control various aspects of the page layout, such as margins, orientation, paper size, and more.
Setting Page Margins
You can set the page margins for a worksheet using the PageSetup class. The following example demonstrates how to set the top, bottom, left, and right margins:
Setting Page Orientation
You can set the page orientation to either portrait or landscape using the PageSetup class. The following example demonstrates how to set the page orientation to landscape:
Setting Paper Size
You can set the paper size for printing using the PageSetup class. The following example demonstrates how to set the paper size to A4:
Setting Print Area
You can define a specific range of cells to be printed using the PageSetup class. The following example demonstrates how to set the print area:
Setting Page Breaks
You can insert page breaks in a worksheet to control where pages end and new pages begin. The following example demonstrates how to insert a horizontal page break:
Setting Header and Footer
You can customize the header and footer of a worksheet using the PageSetup class. The following example demonstrates how to set a custom header and footer:
Setting Print Titles
You can specify rows or columns to repeat at the top or left of each printed page using the PageSetup class. The following example demonstrates how to set print titles:
Setting Print Quality
You can set the print quality for a worksheet using the PageSetup class. The following example demonstrates how to set the print quality:
Setting Print Order
You can set the print order for a worksheet using the PageSetup class. The following example demonstrates how to set the print order to “Over, then Down”:
Setting Print Gridlines
You can control whether gridlines are printed using the PageSetup class. The following example demonstrates how to enable printing of gridlines:
Setting Print Headings
You can control whether row and column headings are printed using the PageSetup class. The following example demonstrates how to enable printing of headings:
Setting Print Black and White
You can control whether the worksheet is printed in black and white using the PageSetup class. The following example demonstrates how to enable black‑and‑white printing:
Setting Print Draft
You can control whether the worksheet is printed in draft quality using the PageSetup class. The following example demonstrates how to enable draft quality printing:
Setting Print Comments
You can control whether comments are printed using the PageSetup class. The following example demonstrates how to enable printing of comments:
Setting Print Errors
You can control how errors are printed using the PageSetup class. The following example demonstrates how to set the error‑printing option:
Setting Print Area Fit to Pages
You can control whether the print area is scaled to fit a specific number of pages using the PageSetup class. The following example demonstrates how to set the print area to fit one page wide and one page tall:
Setting Print Scale
You can set the print scale for a worksheet using the PageSetup class. The following example demonstrates how to set the print scale to 50 %:
Setting Print Center Horizontally and Vertically
You can control whether the worksheet is centered horizontally and vertically on the printed page using the PageSetup class. The following example demonstrates how to center the worksheet horizontally and vertically:
Setting Print First Page Number
You can set the first page number for printing using the PageSetup class. The following example demonstrates how to set the first page number:
Setting Print Page Number
You can control whether the page number is printed using the PageSetup class. The following example demonstrates how to enable printing of the page number:
Setting Print Page Order
You can set the order in which pages are printed using the PageSetup class. The following example demonstrates how to set the page order to “Down, then Over”: