TextFormattingSearchCriteria Class
Represents criteria allowing filtering by text formatting.
Inheritance Hierarchy
SystemObject
  GroupDocs.Watermark.Search.SearchCriteriaSearchCriteria
    GroupDocs.Watermark.Search.SearchCriteriaTextFormattingSearchCriteria

Namespace: GroupDocs.Watermark.Search.SearchCriteria
Assembly: GroupDocs.Watermark (in GroupDocs.Watermark.dll) Version: 20.7.0
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 (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
Remove possible watermarks with a particular text formatting (regardless of document type).
C#
using (Watermarker watermarker = new Watermarker(@"D:\test.doc"))
{
    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;
    criteria.FontBold = true;

    PossibleWatermarkCollection watermarks = watermarker.Search(criteria);
    watermarks.Clear();
    watermarker.Save();
}
See Also