Skip to main content
All docs
V25.1
  • WatermarkManager.Remove(Section, HeaderFooterType) Method

    Removes a watermark from a header of the specified section.

    Namespace: DevExpress.XtraRichEdit.API.Native

    Assembly: DevExpress.RichEdit.v25.1.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.Docx);
    

    The following image demonstrates the result:

    Remove a watermark from the last section

    See Also