Back to Devexpress

SectionMargins.GutterPosition Property

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

latest3.0 KB
Original Source

SectionMargins.GutterPosition Property

Specifies the gutter margin position for a specific section.

Namespace : DevExpress.XtraRichEdit.API.Native

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

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
GutterPosition GutterPosition { get; set; }
vb
Property GutterPosition As GutterPosition

Property Value

TypeDescription
GutterPosition

An enumeration value that indicates gutter margin position.

|

Available values:

NameDescription
Left

A Gutter margin is added to the page left.

| | Right |

A Gutter margin is added to the page right.

|

Remarks

Use the Document.GutterAtTop property to position a gutter margin at the page top. This property specifies gutter margin position for an entire document.

Example

The following code sample adds a left gutter to the first document section:

csharp
using DevExpress.XtraRichEdit;
using DevExpress.XtraRichEdit.API.Native;
using DevExpress.Office.Utils;

using (var wordProcessor = new RichEditDocumentServer()) {
    wordProcessor.LoadDocument(@"Documents//Alice.docx");

    Document document = wordProcessor.Document;

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

    var pageMargins = firstSection.Margins;
    pageMargins.GutterPosition = GutterPosition.Left;
    pageMargins.Gutter = Units.InchesToDocumentsF(1);

    wordProcessor.SaveDocument("Alice_formatted.docx", DocumentFormat.Docx);   
}
vb
Imports DevExpress.XtraRichEdit
Imports DevExpress.XtraRichEdit.API.Native
Imports DevExpress.Office.Utils

Using wordProcessor = New RichEditDocumentServer()
    wordProcessor.LoadDocument("Documents//Alice.docx")

    Dim document As Document = wordProcessor.Document

    Dim firstSection As Section = wordProcessor.Document.Sections(0)

    Dim pageMargins = firstSection.Margins
    pageMargins.GutterPosition = GutterPosition.Left
    pageMargins.Gutter = Units.InchesToDocumentsF(1)

    wordProcessor.SaveDocument("Alice_formatted.docx", DocumentFormat.Docx)
End Using

See Also

SectionMargins Interface

SectionMargins Members

DevExpress.XtraRichEdit.API.Native Namespace