DocumentPartFindWatermarks Method (SearchCriteria)
Finds possible watermarks according to specified search criteria. The search is conducted in objects specified in SearchableObjects.

Namespace: GroupDocs.Watermark
Assembly: GroupDocs.Watermark (in GroupDocs.Watermark.dll) Version: 19.5
Syntax
public PossibleWatermarkCollection FindWatermarks(
	SearchCriteria searchCriteria
)

Parameters

searchCriteria
Type: GroupDocs.Watermark.SearchSearchCriteria
The search criteria to use.

Return Value

Type: PossibleWatermarkCollection
The collection of possible watermarks.
Examples
Find and remove all possible watermarks containing particular text or image from a document of any supported type.
C#
using (Document document = Document.Load(@"D:\input.doc"))
{
    ImageSearchCriteria imageSearchCriteria = new ImageDctHashSearchCriteria(@"D:\logo.png");
    Regex regex = new Regex(@"^Company\sName$", RegexOptions.IgnoreCase);
    TextSearchCriteria textSearchCriteria = new TextSearchCriteria(regex);
    PossibleWatermarkCollection watermarks = document.FindWatermarks(textSearchCriteria.Or(imageSearchCriteria));
    watermarks.Clear();
    document.Save(@"D:\output.doc");
}
See Also