Metadata-Version: 2.4
Name: pdfreader
Version: 0.1.16
Summary: Read and extract text, images, and metadata from PDF files
Home-page: http://github.com/maxpmaxp/pdfreader
Author: Maksym Polshcha
Author-email: maxp@sterch.net
Maintainer: Maksym Polshcha
Maintainer-email: maxp@sterch.net
License: MIT Licence
Keywords: pdf,pdfreader,pdfparser,adobe,parser,cmap
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.6
Description-Content-Type: text/x-rst
License-File: LICENSE
Requires-Dist: bitarray<3,>=2.9.2; python_version < "3.7"
Requires-Dist: bitarray>=2.9.2; python_version >= "3.7"
Requires-Dist: pillow>=7.1.0
Requires-Dist: pycryptodome>=3.19.1
Requires-Dist: python-dateutil>=2.8.1
Requires-Dist: importlib_resources<6,>=5.4; python_version < "3.9"
Provides-Extra: test
Requires-Dist: coverage[toml]<6,>=5.5; python_version < "3.7" and extra == "test"
Requires-Dist: coverage[toml]>=7.0; python_version >= "3.7" and extra == "test"
Requires-Dist: flake8<4,>=3.9; python_version < "3.8" and extra == "test"
Requires-Dist: flake8>=7.0; python_version >= "3.8" and extra == "test"
Requires-Dist: importlib-metadata<5; python_version < "3.8" and extra == "test"
Provides-Extra: docs
Requires-Dist: sphinx<5,>=4.5; python_version < "3.8" and extra == "docs"
Requires-Dist: sphinx>=7.0; python_version >= "3.8" and extra == "docs"
Requires-Dist: setuptools<81; extra == "docs"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: maintainer
Dynamic: maintainer-email
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

=========
pdfreader
=========
:Info: See the `pdfreader documentation <https://pdfreader.readthedocs.io/en/latest/>`_.
:Author & Maintainer: Maksym Polshcha <maxp@sterch.net>

**pdfreader** is a read-only Python PDF parser for extracting text, images,
forms, fonts, CMaps, metadata, and other document objects. Use it when you need
programmatic access to PDF content and structure without editing the file or
rasterizing every page.

The library provides two complementary interfaces:

* ``PDFDocument`` exposes the document catalog, page tree, indirect objects,
  streams, and metadata.
* ``SimplePDFViewer`` interprets page content and writes decoded data to a
  ``SimpleCanvas``.

What pdfreader provides
=======================

* Direct access to the document catalog, page tree, indirect objects, streams,
  and metadata.
* Page-level extraction of decoded strings, images, forms, annotations, and
  inline images through ``SimpleCanvas``.
* Support for password-protected documents that use a supported PDF standard
  security handler.
* Conversion of supported PDF image objects to Pillow images.

pdfreader does not create, edit, split, merge, rasterize, or convert PDF files.
Extracted text follows content-stream order and does not automatically
reconstruct visual lines, columns, or tables.

PDF version compatibility
=========================

pdfreader targets the PDF 1.7 data model and recognizes standard
``%PDF-2.0`` file headers. Header recognition does not imply complete support
for every feature introduced by ISO 32000-2. See the
`PDF compatibility guide <https://pdfreader.readthedocs.io/en/latest/pdf-compatibility.html>`_
for the tested boundary and reporting guidance.

Installation
============

pdfreader is tested on Python 3.6 through Python 3.14. Install it from PyPI with
pip::

  python -m pip install pdfreader

Quick example
=============

Extract decoded string fragments from the first page::

  from pdfreader import SimplePDFViewer

  with open("document.pdf", "rb") as stream:
      viewer = SimplePDFViewer(stream)
      viewer.navigate(1)
      viewer.render()
      text = "".join(viewer.canvas.strings)

Documentation
=============

* `Install or upgrade pdfreader <https://pdfreader.readthedocs.io/en/latest/installation.html>`_
* `Follow the tutorial <https://pdfreader.readthedocs.io/en/latest/tutorial.html>`_
* `Check PDF version compatibility <https://pdfreader.readthedocs.io/en/latest/pdf-compatibility.html>`_
* `Choose PDFDocument or SimplePDFViewer <https://pdfreader.readthedocs.io/en/latest/examples/document_vs_viewer.html>`_
* `Browse task-based examples <https://pdfreader.readthedocs.io/en/latest/examples/index.html>`_
* `Read the API reference <https://pdfreader.readthedocs.io/en/latest/api/index.html>`_

Support and source
==================

Use `GitHub issues <https://github.com/maxpmaxp/pdfreader/issues>`_ for bug
reports, questions, and feature requests. The latest source is available in the
`GitHub repository <https://github.com/maxpmaxp/pdfreader>`_.

References
==========

* `PDF 1.7 specification <https://opensource.adobe.com/dc-acrobat-sdk-docs/standards/pdfstandards/pdf/PDF32000_2008.pdf>`_
* `Adobe CMap and CIDFont specification <https://www.adobe.com/content/dam/acom/en/devnet/font/pdfs/5014.CIDFont_Spec.pdf>`_
* `Adobe CMap resources <https://github.com/adobe-type-tools/cmap-resources>`_
