How to: Configure the Page Layout Programmatically
This example illustrates how to adjust page settings in code.
The page layout settings in the API pertain to the document’s section. Therefore, you need to change the SectionPage properties to adjust page settings.
The following code specifies the page layout settings for the first section of the document: the A6 paper in landscape orientation with the left margin set to two inches.
document.Unit = DevExpress.Office.DocumentUnit.Inch; document.Sections.Page.PaperKind = System.Drawing.Printing.PaperKind.A6; document.Sections.Page.Landscape = true; document.Sections.Margins.Left = 2.0f;