TextSearchCriteria Class
Represents criteria allowing filtering by watermark text.
Inheritance Hierarchy
SystemObject
  GroupDocs.Watermark.Search.SearchCriteriaSearchCriteria
    GroupDocs.Watermark.Search.SearchCriteriaTextSearchCriteria

Namespace: GroupDocs.Watermark.Search.SearchCriteria
Assembly: GroupDocs.Watermark (in GroupDocs.Watermark.dll) Version: 20.7.0
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 with a search string.
Public methodTextSearchCriteria(Regex)
Initializes a new instance of the TextSearchCriteria class with a specified regular expression.
Public methodTextSearchCriteria(String, Boolean)
Initializes a new instance of the TextSearchCriteria class with a search string and a flag for comparison.
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 (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (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 (Inherited from Object.)
Remarks
Examples
Find and remove watermark using search criteria.
C#
using (Watermarker watermarker = new Watermarker(@"C:\test.some_ext"))
{
    SizeSearchCriteria widthRange = new SizeSearchCriteria(Dimension.Width, 50, 100);
    RotateAngleSearchCriteria rotateAngle = new RotateAngleSearchCriteria(0, 45);
    TextSearchCriteria textCriteria = new TextSearchCriteria(new Regex("^Test watermark$"));
    PossibleWatermarkCollection watermarks = watermarker.Search(textCriteria.And(widthRange.Or(rotateAngle)));
    watermarks.Clear();
    watermarker.Save();
}
See Also