Skip to main content

SectionMargins Interface

Provides access to the properties of margins in a Section.

Namespace: DevExpress.XtraRichEdit.API.Native

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

NuGet Package: DevExpress.RichEdit.Core

Declaration

[ComVisible(true)]
public interface SectionMargins

The following members return SectionMargins objects:

Remarks

This class introduces the SectionMargins.Top, SectionMargins.Right, SectionMargins.Bottom and SectionMargins.Left properties, which specify section margins.

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