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
| Name | Type | Access | Description |
|---|---|---|---|
WHITESPACE | `` | Read | Gets the whitespace. |
DELIMITERS | `` | Read | Gets the delimiters. |
Methods
| Signature | Description |
|---|---|
__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() → str | Extract and return the textual content of the stream. |
best_effort_extract_text() → str | Robust fallback: extract all strings/hex-strings regardless of BT/ET state. |