Skip to main content

Section.Margins Property

Provides access to an object used to specify or retrieve a section’s margin settings.

Namespace: DevExpress.XtraRichEdit.API.Native

Assembly: DevExpress.RichEdit.v24.1.Core.dll

NuGet Packages: DevExpress.RichEdit.Core, DevExpress.Win.Navigation

Declaration

SectionMargins Margins { get; }

Property Value

Type Description
SectionMargins

An object exposing the SectionMargins interface used to control section margin settings.

Example

The following code snippet changes the first section’s margins:

using DevExpress.XtraRichEdit;
using DevExpress.XtraRichEdit.API.Native;

using (var wordProcessor = new RichEditDocumentServer()) {
    wordProcessor.LoadDocument("Document.docx");

    Document document = wordProcessor.Document;

    Section firstSection = wordProcessor.Document.Sections[0];

    var pageMargins = firstSection.Margins;
    pageMargins.Left = Units.InchesToDocumentsF(0.5f);
    pageMargins.Top = Units.InchesToDocumentsF(0.7f);
    pageMargins.Right = Units.InchesToDocumentsF(0.5f);
    pageMargins.Bottom = Units.InchesToDocumentsF(1.5f);
}
See Also