WatermarkManager.Remove(Section, HeaderFooterType) Method
Removes a watermark from a header of the specified section.
Namespace: DevExpress.XtraRichEdit.API.Native
Assembly: DevExpress.RichEdit.v24.1.Core.dll
NuGet Packages: DevExpress.RichEdit.Core, DevExpress.Win.Navigation
Declaration
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:
See Also