officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-section.md
Provides access to an object used to specify or retrieve a section’s page settings.
Namespace : DevExpress.XtraRichEdit.API.Native
Assembly : DevExpress.RichEdit.v25.2.Core.dll
NuGet Package : DevExpress.RichEdit.Core
SectionPage Page { get; }
ReadOnly Property Page As SectionPage
| Type | Description |
|---|---|
| SectionPage |
An object exposing the SectionPage interface used to control section page settings.
|
The following code sample specifies page layout settings for the first section of the document: the A6 paper in landscape orientation with the left margin set to two inches.
using DevExpress.XtraRichEdit;
using DevExpress.XtraRichEdit.API.Native;
using DevExpress.Drawing.Printing;
using DevExpress.Utils;
using (var wordProcessor = new RichEditDocumentServer()) {
wordProcessor.LoadDocument("Documents\\Grimm.docx");
Document document = wordProcessor.Document;
document.Sections[0].Page.PaperKind = DXPaperKind.A6;
document.Sections[0].Page.Landscape = true;
document.Sections[0].Margins.Left = Units.InchesToDocumentsF(2.0f);
}
Imports DevExpress.XtraRichEdit
Imports DevExpress.XtraRichEdit.API.Native
Imports DevExpress.Drawing.Printing
Imports DevExpress.Utils
Using wordProcessor = New RichEditDocumentServer()
wordProcessor.LoadDocument("Documents\Grimm.docx")
Dim document As Document = wordProcessor.Document
document.Sections(0).Page.PaperKind = DXPaperKind.A6
document.Sections(0).Page.Landscape = True
document.Sections(0).Margins.Left = Units.InchesToDocumentsF(2.0F)
End Using
The following code snippets (auto-collected from DevExpress Examples) contain references to the Page property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
winforms-richedit-document-api/CS/RichEditAPISample/CodeExamples/PageLayout.cs#L29
SectionColumnCollection sectionColumnsLayout =
firstSection.Columns.CreateUniformColumns(firstSection.Page, 0.2f, 3);
// Set different column width.
wpf-richedit-document-api/CS/DXRichEditControlAPISample/CodeExamples/PageLayoutActions.cs#L34
SectionColumnCollection sectionColumnsLayout =
firstSection.Columns.CreateUniformColumns(firstSection.Page, 0.2f, 3);
firstSection.Columns.SetColumns(sectionColumnsLayout);
word-document-api-examples/CS/CodeExamples/PageLayoutActions.cs#L55
SectionColumnCollection sectionColumnsLayout =
firstSection.Columns.CreateUniformColumns(firstSection.Page, 0.2f, 3);
winforms-richedit-document-api/VB/RichEditAPISample/CodeExamples/PageLayout.vb#L26
' Create equal width column layout.
Dim sectionColumnsLayout As DevExpress.XtraRichEdit.API.Native.SectionColumnCollection = firstSection.Columns.CreateUniformColumns(firstSection.Page, 0.2F, 3)
' Set different column width.
wpf-richedit-document-api/VB/DXRichEditControlAPISample/CodeExamples/PageLayoutActions.vb#L24
' Create columns and apply them to the document
Dim sectionColumnsLayout As SectionColumnCollection = firstSection.Columns.CreateUniformColumns(firstSection.Page, 0.2F, 3)
firstSection.Columns.SetColumns(sectionColumnsLayout)
word-document-api-examples/VB/CodeExamples/PageLayoutActions.vb#L50
' Create a uniform column layout.
Dim sectionColumnsLayout As DevExpress.XtraRichEdit.API.Native.SectionColumnCollection = firstSection.Columns.CreateUniformColumns(firstSection.Page, 0.2F, 3)
' Apply the column layout to the section.
See Also