

'DeclarationPublic Class PageLayout Inherits WorksheetElement
'UsageDim instance As PageLayout
public class PageLayout : WorksheetElement
public static void PageOrientationAndSetup() { using( var workbook = Workbook.Create(PageLayoutSample.PageLayoutSampleOutputDirectory + @"PageSetup.xlsx")) { //Gets the first worksheet; a workbook contains at least 1 worksheet. var worksheet = workbook.Worksheets[0]; // Adds a title. worksheet.Cells["B1"].Value = "Page Setup"; worksheet.Cells["B1"].Style.Font = new Font() {Bold = true, Size = 15.5d}; // Sets the Landscape orientation. worksheet.PageLayout.Orientation = OrientationType.Landscape; // Adjusts the paper size. worksheet.PageLayout.PageSize = PaperSizeType.Executive; // Adjusts the scale, which is a percentage. worksheet.PageLayout.Scale = 120; // Sets various printing options. worksheet.PageLayout.BlackAndWhite = true; worksheet.PageLayout.DraftQuality = true; worksheet.PageLayout.GridLines = true; worksheet.PageLayout.Headings = true; worksheet.PageLayout.HorizontalCentered = true; worksheet.PageLayout.VerticalCentered = true; // Saves the workbook to disk. workbook.Save(); Console.WriteLine( "/tCreated: PageSetup.xlsx/n" ); } }
System.Object
Xceed.Workbooks.NET.WorkbookElement
Xceed.Workbooks.NET.WorksheetElement
Xceed.Workbooks.NET.PageLayout
| Name | Description | |
|---|---|---|
![]() | PageLayout Constructor |
| Name | Description | |
|---|---|---|
![]() | BlackAndWhite | Gets or sets if the Worksheet(s) will be printed in black & white or not. |
![]() | ColumnBreaks | Gets a list of indexes that correspond to all of the column breaks in the Worksheet. |
![]() | DraftQuality | Gets or sets whether the Worksheet(s) will be printed in draft quality or not. |
![]() | FitToPageHeight | Gets or sets how the content's height will be scaled when the Worksheet is printed. |
![]() | FitToPageWidth | Gets or sets how the content's width will be scaled when the Worksheet is printed. |
![]() | GridLines | Gets or sets if gridlines should be printed or not. |
![]() | Headings | Gets or sets whether headings will be printed or not. |
![]() | HorizontalCentered | Gets or sets if the content will be centered horizontally when the Worksheet(s) is printed. |
![]() | Margins | Gets the Worksheet's Margins. |
![]() | Orientation | Gets or sets the page's orientation. |
![]() | PaperSize | Gets or sets the page's size. |
![]() | RowBreaks | Gets a list of indexes that correspond to all of the row breaks in the Worksheet. |
![]() | Scale | Gets or sets the percentage by which the Worksheet's content will be scaled before it is printed. |
![]() | VerticalCentered | Gets or sets if the content will be centered vertically when the Worksheet(s) is printed. |
| Name | Description | |
|---|---|---|
![]() | Equals | Overloaded. |
![]() | GetHashCode | |
![]() | InsertPageBreakColumn | Inserts a page break at the left of a specific Column. |
![]() | InsertPageBreakRow | Inserts a page break on top of a specific Row. |
![]() | InsertPageBreaks | Inserts page breaks in the Worksheet, using a Row & a Column to determine where those page breaks will be inserted. |
![]() | InsertPageBreaksAtCell | Inserts page breaks in the Worksheet, using the location of a specific Cell to determine where those page breaks will be inserted. |
![]() | RemovePageBreakColumn | Removes the page break at the left of a specific Column. |
![]() | RemovePageBreakRow | Removes the page break that is located on top of a specific Row. |
![]() | RemovePageBreaks | Removes page breaks from the Worksheet, using a Row & a Column to determine which page breaks will be removed. |
![]() | RemovePageBreaksAtCell | Removes page breaks from the Worksheet, using the location of a specific Cell to determine which page breaks will be removed. |
![]() | ResetAllPageBreaks | Resets all page breaks to their default state. |
.NET: net5.0, net5.0-windows, net6.0, net6.0-macos, net6.0-windows, net7.0, net7.0-macos, net7.0-windows, net8.0, net8.0-browser, net8.0-macos, net8.0-windows, net9.0, net9.0-browser, net9.0-macos, net9.0-windows, net10.0, net10.0-browser, net10.0-macos, net10.0-windows.
.NET Framework: net40, net403, net45, net451, net452, net46, net461, net462, net463, net47, net471, net472, net48, net481.