Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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