Back to Devexpress

Section.Page Property

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-section.md

latest5.8 KB
Original Source

Section.Page Property

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

Declaration

csharp
SectionPage Page { get; }
vb
ReadOnly Property Page As SectionPage

Property Value

TypeDescription
SectionPage

An object exposing the SectionPage interface used to control section page settings.

|

Example

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.

View Example

csharp
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);
}
vb
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

csharp
SectionColumnCollection sectionColumnsLayout =
    firstSection.Columns.CreateUniformColumns(firstSection.Page, 0.2f, 3);
// Set different column width.

wpf-richedit-document-api/CS/DXRichEditControlAPISample/CodeExamples/PageLayoutActions.cs#L34

csharp
SectionColumnCollection sectionColumnsLayout =
    firstSection.Columns.CreateUniformColumns(firstSection.Page, 0.2f, 3);
firstSection.Columns.SetColumns(sectionColumnsLayout);

word-document-api-examples/CS/CodeExamples/PageLayoutActions.cs#L55

csharp
SectionColumnCollection sectionColumnsLayout =
    firstSection.Columns.CreateUniformColumns(firstSection.Page, 0.2f, 3);

winforms-richedit-document-api/VB/RichEditAPISample/CodeExamples/PageLayout.vb#L26

vb
' 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

vb
' 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

vb
' 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

Section Interface

Section Members

DevExpress.XtraRichEdit.API.Native Namespace