.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

How to: Set Paper Size

IMPORTANT

You need a license to the DevExpress Office File API or DevExpress Universal Subscription to use these examples in production code. Refer to the DevExpress Subscription page for pricing information.

This example demonstrates how to set the paper size of worksheet pages via the Worksheet.ActiveView.PaperKind property. The PaperKind enumerator lists available page sizes.

NOTE

The WorksheetView.PaperKind property value is used when worksheet pages are printed. To learn how to specify other worksheet print options, see the How to: Specify Print Settings document.

// Select the page's paper size.
workbook.Worksheets[0].ActiveView.PaperKind = System.Drawing.Printing.PaperKind.A4;
See Also