Document Solutions for Excel, .NET Edition | Document Solutions
Features / Print / Page Setup / Configure Paper Settings
In This Topic
    Configure Paper Settings
    In This Topic

    In DsExcel .NET, you can use the properties of the IPageSetup interface in order to configure paper settings for customized printing.

    Configuring paper settings involves the following tasks:

    1. Configure Paper Scaling
    2. Configure Paper Size

    Configure Paper Scaling

    You can use the IsPercentScale property in order to control how to the spreadsheet is scaled; the FitToPagesTall property and the FitToPagesWide property in order to set its size; and the Zoom property in order to adjust the size of the paper that will be used for printing.

    C#
    Copy Code
    //Set paper scaling via percent scale 
                
    worksheet.PageSetup.IsPercentScale = true;
    worksheet.PageSetup.Zoom = 150;
                
    //Set paper scaling via FitToPagesWide and FitToPagesTall    
                
    worksheet.PageSetup.IsPercentScale = false;
    worksheet.PageSetup.FitToPagesWide = 3;
    worksheet.PageSetup.FitToPagesTall = 4;            
                

    Configure Paper Size

    You can use the PaperSize property in order to set the paper size for the paper that will be used for printing.

    C#
    Copy Code
    //Set built-in paper size. The Default is Letter
                
    worksheet.PageSetup.PaperSize = PaperSize.A4;