TextSearchOptions class

TextSearchOptions class

Represents search options for Text signatures.

Learn more:

The TextSearchOptions type exposes the following members:

Constructors

Constructor Description
init Initializes a new instance of the TextSearchOptions class with default values.
init Initializes a new instance of the TextSearchOptions class with a text value.

Properties

Property Description
match_type The text match type used for searching.
signature_implementation The text signature implementation to search.
text The signature text to match when searching.
all_pages The flag indicating whether to search on each document page. By default this value is True. (inherited from SearchOptions)
page_number The document page number for searching (optional). (inherited from SearchOptions)
pages_setup The options to specify pages for signature searching. (inherited from SearchOptions)
shape_position The flag indicating whether to return the shape position in the document layout. Available only for Word documents. (inherited from SearchOptions)
skip_external The flag to return only signatures marked as IsSignature. By default the value is False, which indicates that all signatures matching the specified criteria are returned. (inherited from SearchOptions)

Example

from groupdocs.signature import Signature
from groupdocs.signature.domain import TextMatchType, TextSignatureImplementation
from groupdocs.signature.options import TextSearchOptions

with Signature("signed.pdf") as signature:
    options = TextSearchOptions()
    options.all_pages = False
    options.page_number = 1
    options.text = "John"
    options.match_type = TextMatchType.CONTAINS
    options.signature_implementation = TextSignatureImplementation.NATIVE

    result = signature.search([options])
    print(f"Found {len(result.signatures)} matching text signature(s)")
    for ts in result.signatures:
        print(f"'{ts.text}' on page {ts.page_number} at ({ts.left}, {ts.top}), size {ts.width}x{ts.height}")

Guides

Task guides that use TextSearchOptions:

See Also