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:
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; |
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;
|