TextSearchCriteria class

TextSearchCriteria class

Represents criteria allowing filtering by watermark text.

Learn more:

The TextSearchCriteria type exposes the following members:

Constructors

Constructor Description
init Initializes a new TextSearchCriteria with a specified regular expression.
init Initializes a new instance of the TextSearchCriteria class with a search string and a flag for case‑sensitive comparison.
init Initializes a new instance of the TextSearchCriteria class with a search string.

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
pattern The regular expression pattern to match.
skip_unreadable_characters The property indicating whether unreadable characters are skipped during string comparison.
pages The list of specific page numbers. (inherited from PageSearchCriteria)

Example

from groupdocs.watermark import Watermarker
from groupdocs.watermark.search.search_criteria import TextSearchCriteria

def search_by_text():
    with Watermarker("./document.pdf") as watermarker:
        possible = watermarker.search(TextSearchCriteria("CONFIDENTIAL"))
        print("Found", len(possible), "possible watermark(s)")

if __name__ == "__main__":
    search_by_text()

Guides

Task guides that use TextSearchCriteria:

See Also