TextFormattingSearchCriteria class

TextFormattingSearchCriteria class

Represents criteria allowing filtering by text formatting.

The TextFormattingSearchCriteria type exposes the following members:

Constructors

Constructor Description
init Initializes a new instance of the TextFormattingSearchCriteria class.

Methods

Method Description
and_ Combines this SearchCriteria with other criteria using the logical AND operator. (inherited from SearchCriteria)
and_search_criteria (inherited from SearchCriteria)
not_ Negates this SearchCriteria. (inherited from SearchCriteria)
or_ Combines this SearchCriteria with other criteria using logical OR operator. (inherited from SearchCriteria)
or_search_criteria (inherited from SearchCriteria)

Properties

Property Description
background_color_range The range of colors which are used to filter watermarks by text background color.
font_bold The font used in watermark text formatting is bold.
font_italic The font italic flag indicates whether the font used in watermark text formatting is italic.
font_name The name of the font used in possible watermark text formatting.
font_strikeout The font strikeout flag for watermark text formatting.
font_underline The font underline flag indicates whether the font used in watermark text formatting is underlined.
foreground_color_range The range of colors used to filter watermarks by text foreground color.
max_font_size The ending value of the font size.
min_font_size The starting value of the font size.

Example

import groupdocs.watermark as gw
import groupdocs.watermark.search.searchcriteria as gws_sc

with gw.Watermarker("document.pdf") as watermarker:
    criteria = gws_sc.TextFormattingSearchCriteria()
    criteria.foreground_color_range = gws_sc.ColorRange()
    criteria.foreground_color_range.min_hue = -5
    criteria.foreground_color_range.max_hue = 10
    criteria.foreground_color_range.min_brightness = 0.01
    criteria.foreground_color_range.max_brightness = 0.99
    criteria.background_color_range = gws_sc.ColorRange()
    criteria.background_color_range.is_empty = True
    criteria.font_name = "Arial"
    criteria.min_font_size = 19
    criteria.max_font_size = 42
    criteria.font_bold = True

    possible = watermarker.search(criteria)
    print("Found", possible.count, "possible watermark(s)")

Guides

Task guides that use TextFormattingSearchCriteria:

See Also