PdfExtractor

Overview

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

Simple PDF text and image extractor.

This class provides 14 methods for working with PdfExtractor objects in Python programs. Available methods include: __init__, bind_pdf, close, dispose, extract_attachment, extract_image, extract_text, get_attach_names, get_attachment, get_next_image, get_next_page_text, get_text, and 2 additional methods. All public members are accessible to any Python application after installing the Aspose.PDF FOSS for Python package. Properties: password.

Properties

NameTypeAccessDescription
passwordstr | NoneRead/WriteOptional owner/user password used when binding encrypted PDFs (maps .NET Password).

Methods

SignatureDescription
__init__()Calls init on this PdfExtractor instance.
close()Close the extractor and release resources.
dispose()Mark the extractor as disposed.
bind_pdf(source: str | Path | bytes, password: str | None, limits: PdfLoadLimits | None)Bind to a PDF source for extraction.
extract_text()Extract text from bound PDF pages.
get_text()strReturn all extracted text concatenated.
get_next_page_text()strReturn text for the next page, advancing cursor.
has_next_page_text()boolReturn True if there is another page’s text available.
extract_image()Extract images from bound PDF.
has_next_image()boolReturn True if there is another image available.
get_next_image()AnyReturn the next image, advancing cursor.
extract_attachment()Extract attachments from bound PDF.
get_attachment(name: str)AnyReturn attached file by name.
get_attach_names()list[str]Return list of attachment names.

See Also