PageSetup.CustomPaperSize

PageSetup.CustomPaperSize method

Sets the custom paper size, in unit of inches.

public void CustomPaperSize(double width, double height)
ParameterTypeDescription
widthDoubleThe width of the paper.
heightDoubleThe height of the paper.

Examples

using System;
using Aspose.Cells;

namespace AsposeCellsExamples
{
    public class PageSetupMethodCustomPaperSizeWithDoubleDoubleDemo
    {
        public static void Run()
        {
            Workbook workbook = new Workbook();
            Worksheet worksheet = workbook.Worksheets[0];
            
            // Set custom paper size (width: 1.5 inches, height: 1.5 inches)
            worksheet.PageSetup.CustomPaperSize(1.5, 1.5);
            
            // Save the workbook to demonstrate the effect
            workbook.Save("CustomPaperSizeDemo.xlsx");
        }
    }
}

See Also