Skip to main content
All docs
V23.2

WatermarkManager.Remove(Section, HeaderFooterType) Method

Removes a watermark from a header of the specified section.

Namespace: DevExpress.XtraRichEdit.API.Native

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

NuGet Packages: DevExpress.RichEdit.Core, DevExpress.Win.Navigation

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