TextSearchCriteria Class
Represents criteria allowing filtering by watermark text.
Inheritance Hierarchy

Namespace: GroupDocs.Watermark.Search
Assembly: GroupDocs.Watermark (in GroupDocs.Watermark.dll) Version: 19.5
Syntax
public class TextSearchCriteria : SearchCriteria

The TextSearchCriteria type exposes the following members.

Constructors
  NameDescription
Public methodTextSearchCriteria(String)
Initializes a new instance of the TextSearchCriteria class.
Public methodTextSearchCriteria(Regex)
Initializes a new instance of the TextSearchCriteria class.
Public methodTextSearchCriteria(String, Boolean)
Initializes a new instance of the TextSearchCriteria class.
Properties
  NameDescription
Public propertyPattern
Gets the search pattern.
Public propertySkipUnreadableCharacters
Gets or sets a value indicating that unreadable characters will be skipped during string comparison.
Methods
  NameDescription
Public methodAnd
Combines this SearchCriteria with other criteria using logical AND operator.
(Inherited from SearchCriteria.)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodNot
Negates this SearchCriteria.
(Inherited from SearchCriteria.)
Public methodOr
Combines this SearchCriteria with other criteria using logical OR operator.
(Inherited from SearchCriteria.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Examples
Find and remove all possible watermarks containing a particular text from a document of any supported format.
C#
var regex = new Regex(@"Company\sName", RegexOptions.IgnoreCase);
var textSearchCriteria = new TextSearchCriteria(regex);
foreach (string file in Directory.GetFiles(@"D:\docs"))
{
    using (Document doc = Document.Load(file))
    {
        var watermarks = doc.FindWatermarks(textSearchCriteria);
        watermarks.Clear();
        doc.Save();
    }
}
See Also