TextAbsorber

Overview

TextAbsorber is a class in Aspose.PDF FOSS for Python.

Absorbs text from PDF pages (legacy class, alias for TextFragmentAbsorber).

This class provides 5 methods for working with TextAbsorber objects in Python programs. Available methods include: __init__, apply_for_all_fragments, remove_all_text, reset, visit. All public members are accessible to any Python application after installing the Aspose.PDF FOSS for Python package. Properties: text, text_fragments.

Properties

NameTypeAccessDescription
textstrReadGet all collected text as a single string.
text_fragmentslist[TextFragment]ReadList of text fragments found.

Methods

SignatureDescription
__init__(phrase: str | None, text_search_options: TextSearchOptions | None, text_replace_options: Any | None)Initialize text absorber.
visit(page_or_doc: Any)Process page or document and collect text.
reset()Clear all collected text fragments.
remove_all_text()Remove all collected text fragments.
apply_for_all_fragments(action: Callable[[TextFragment], Any])list[Any]Apply action to every collected fragment.

See Also