officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-watermarkmanager-c435b5aa.md
Removes watermarks from the document.
Namespace : DevExpress.XtraRichEdit.API.Native
Assembly : DevExpress.RichEdit.v25.2.Core.dll
NuGet Package : DevExpress.RichEdit.Core
void Remove()
Sub Remove
The code sample below removes an image watermark from the document. Use the WatermarkManager.Type property to check the watermark type.
using (RichEditDocumentServer wordProcessor = new RichEditDocumentServer())
{
wordProcessor.LoadDocument("FirstLook.docx");
WatermarkManager watermarkManager =
wordProcessor.Document.WatermarkManager;
if (watermarkManager.Type == WatermarkType.Image)
{
watermarkManager.Remove();
}
wordProcessor.SaveDocument("FirstLook_new.docx", DocumentFormat.Docx);
}
Using wordProcessor As New RichEditDocumentServer()
wordProcessor.LoadDocument("FirstLook.docx")
Dim watermarkManager As WatermarkManager = wordProcessor.Document.WatermarkManager
If watermarkManager.Type = WatermarkType.Image Then
watermarkManager.Remove()
End If
wordProcessor.SaveDocument("FirstLook_new.docx", DocumentFormat.Docx)
End Using
See Also