Aspose.Cells.Examples.CSharp.Worksheets.PageSetupFeatures.SetMargins.Run C# (CSharp) Method

Run() public static method

public static Run ( ) : void
return void
        public static void Run()
        {
            // ExStart:1
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

            // Create a workbook object
            Workbook workbook = new Workbook();

            // Get the worksheets in the workbook
            WorksheetCollection worksheets = workbook.Worksheets;

            // Get the first (default) worksheet
            Worksheet worksheet = worksheets[0];

            // Get the pagesetup object
            PageSetup pageSetup = worksheet.PageSetup;

            // Set bottom,left,right and top page margins
            pageSetup.BottomMargin = 2;
            pageSetup.LeftMargin = 1;
            pageSetup.RightMargin = 1;
            pageSetup.TopMargin = 3;

            // Save the Workbook.
            workbook.Save(dataDir + "SetMargins_out.xls");
            // ExEnd:1
        }
        public static void CenterOnPage()