ContentStreamParser

ContentStreamParser

Overview

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

Parse a PDF content stream and extract plain text.

This class provides 3 methods for working with ContentStreamParser objects in Python programs. Available methods include: __init__, best_effort_extract_text, extract_text. All public members are accessible to any Python application after installing the Aspose.PDF FOSS for Python package. Properties: DELIMITERS, WHITESPACE.

Properties

NameTypeAccessDescription
WHITESPACE``ReadGets the whitespace.
DELIMITERS``ReadGets the delimiters.

Methods

SignatureDescription
__init__(content_stream: bytes, resources: dict[str, Any], limits: PdfLoadLimits | None, budget: _LoadBudget | None)Calls init(content_stream, resources, limits, budget) on this ContentStreamParser instance.
extract_text()strExtract and return the textual content of the stream.
best_effort_extract_text()strRobust fallback: extract all strings/hex-strings regardless of BT/ET state.

See Also