Skip to main content
All docs
V24.2

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

WatermarkManager.Remove(Section, HeaderFooterType) Method

Removes a watermark from a header of the specified section.

Namespace: DevExpress.XtraRichEdit.API.Native

Assembly: DevExpress.RichEdit.v24.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