Skip to main content
A newer version of this page is available. .
All docs
V21.2
.NET Framework 4.5.2+

WatermarkManager.Remove(Section, HeaderFooterType) Method

Removes a watermark from a header of the specified section.

Namespace: DevExpress.XtraRichEdit.API.Native

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

NuGet Package: DevExpress.RichEdit.Core

Declaration

void Remove(
    Section section,
    HeaderFooterType type
)

Parameters

Name Type Description
section Section

The target section.

type HeaderFooterType

The type of the section’s header that contains the watermark to be removed.

Remarks

The example below adds a text watermark to all document sections and then removes the watermark from the last section.

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

document.LoadDocument(@"Documents\Watermarks.docx");

// Add a text watermark to the document.
document.WatermarkManager.SetText("DO NOT COPY");

// Remove the watermark from the last section.
var lastSection = document.Sections[document.Sections.Count - 1];
document.WatermarkManager.Remove(lastSection, HeaderFooterType.Primary);

document.SaveDocument(@"Documents\WatermarksUpd.docx", DocumentFormat.OpenXml);

The following image demonstrates the result:

Remove a watermark from the last section

See Also