TextFormattingSearchCriteria class

TextFormattingSearchCriteria class

Represents criteria allowing filtering by text formatting.

Learn more:

The TextFormattingSearchCriteria type exposes the following members:

Constructors

Constructor Description
init Initializes a new instance of TextFormattingSearchCriteria.

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 the 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 property indicates whether the watermark text font is italic.
font_name The name of the font used in possible watermark text formatting.
font_strikeout The font strikeout flag for the watermark text formatting.
font_underline The font underline flag indicating whether the watermark text uses an underline.
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

from groupdocs.watermark import Watermarker
from groupdocs.watermark.search.search_criteria import TextFormattingSearchCriteria, ColorRange

def search_by_formatting():
    with Watermarker("./document.pdf") as watermarker:
        criteria = TextFormattingSearchCriteria()
        criteria.foreground_color_range = ColorRange()
        criteria.foreground_color_range.min_hue = -15
        criteria.foreground_color_range.max_hue = 15
        criteria.foreground_color_range.min_brightness = 0.01
        criteria.foreground_color_range.max_brightness = 0.99
        criteria.min_font_size = 19
        criteria.max_font_size = 42

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

if __name__ == "__main__":
    search_by_formatting()

Guides

Task guides that use TextFormattingSearchCriteria:

See Also