'Declaration
Public Class PageLayout Inherits WorksheetElement
'Usage
Dim instance As PageLayout
public class PageLayout : WorksheetElement
'Declaration
Public Class PageLayout Inherits WorksheetElement
'Usage
Dim 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
Target Platforms: Windows 11, Windows 10, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2