TextFormattingSearchCriteria Class
Represents criteria allowing filtering by text formatting.
Inheritance Hierarchy
SystemObject
  GroupDocs.Watermark.SearchSearchCriteria
    GroupDocs.Watermark.SearchTextFormattingSearchCriteria

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

The TextFormattingSearchCriteria type exposes the following members.

Constructors
  NameDescription
Public methodTextFormattingSearchCriteria
Initializes a new instance of the TextFormattingSearchCriteria class
Properties
  NameDescription
Public propertyBackgroundColorRange
Gets or sets the range of colors which are used to filter watermarks by text background color.
Public propertyFontBold
Gets or sets a value indicating whether the font used in watermark text formatting is bold.
Public propertyFontItalic
Gets or sets a value indicating whether the font used in watermark text formatting is italic.
Public propertyFontName
Gets or sets the name of the font which is used in possible watermark text formatting.
Public propertyFontStrikeout
Gets or sets a value indicating whether the font used in watermark text formatting is strikeout.
Public propertyFontUnderline
Gets or sets a value indicating whether the font used in watermark text formatting is underline.
Public propertyForegroundColorRange
Gets or sets the range of colors which are used to filter watermarks by text foreground color.
Public propertyMaxFontSize
Gets or sets the ending value of the font size.
Public propertyMinFontSize
Gets or sets the starting value of the font size.
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
Remove possible watermarks with a particular text formatting (regardless of document type).
C#
TextFormattingSearchCriteria criteria = new TextFormattingSearchCriteria();
criteria.ForegroundColorRange = new ColorRange();
criteria.ForegroundColorRange.MinHue = -5;
criteria.ForegroundColorRange.MaxHue = 10;
criteria.ForegroundColorRange.MinBrightness = 0.01f;
criteria.ForegroundColorRange.MaxBrightness = 0.99f;
criteria.BackgroundColorRange = new ColorRange();
criteria.BackgroundColorRange.IsEmpty = true;
criteria.FontName = "Arial";
criteria.MinFontSize = 19;
criteria.MaxFontSize = 42;

foreach (string file in Directory.GetFiles(@"D:\docs"))
{
    using (Document doc = Document.Load(file))
    {
       var watermarks = doc.FindWatermarks(criteria);
        watermarks.Clear();
        doc.Save();
    }
}
See Also