Skip to main content

readablepdf

readablepdf converts image-only PDFs into searchable and selectable PDFs by adding an OCR text layer while preserving page visuals.

How it works

  1. Render each page to a PNG (pdf2image backed by Poppler).
  2. OCR each page with Tesseract in PDF mode (image layer + invisible text layer).
  3. Merge all OCR page PDFs into one output PDF.

All intermediate files are written inside an OS temporary directory and removed automatically.

System dependencies (Linux + macOS)

You need these binaries on the machine where you run readablepdf:

  • tesseract
  • pdftoppm (from Poppler)

Ubuntu/Debian:

sudo apt update
sudo apt install -y tesseract-ocr poppler-utils

macOS (Homebrew):

brew install tesseract poppler

If you need languages beyond English, install matching Tesseract language packs.

Install and run with pipx

Once published on PyPI, you can run it directly without managing a virtualenv:

pipx run readablepdf input.pdf

Custom output/language/DPI:

pipx run readablepdf input.pdf -o output_ocr.pdf --lang eng --dpi 200

Local development

python3 -m venv .venv
source .venv/bin/activate
pip install -e .[dev]
ruff check .
ruff format --check .
pytest -q
python -m build

GitHub Actions

  • CI workflow: lint + format check + tests + build on Ubuntu and macOS.
  • Publish to PyPI workflow: runs on GitHub Release publish (and manual trigger).

GitHub configuration needed for publish

  1. Create repository secret: PYPI_API_TOKEN.
  2. Set it to a PyPI API token with upload permission for this project.
  3. (Optional but recommended) create a protected environment named pypi and require approvals.

Release flow

  1. Merge to main.
  2. Create a Git tag/release (for example v0.1.1).
  3. Publish to PyPI workflow uploads artifacts to PyPI with version derived from that tag.

Metadata

Release files for readablepdf 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for readablepdf 0.2.0
File Size Uploaded
readablepdf-0.2.0.tar.gz 5.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for readablepdf 0.2.0
File Interpreter ABI Platform
readablepdf-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.6 kB

Release files / readablepdf-0.2.0.tar.gz

Download URL readablepdf-0.2.0.tar.gz
Size 5.9 kB
Tags Source
SHA-256 checksum
How to use checksums
2096fa5f11b9c4933ee1f3fe816c660f6c678fffdee21e08831c445e9b43dd70
BLAKE2b-256 checksum
How to use checksums
c0b18e20619e395c1b78e4d8434f13e9624ab413aed0281693bfda7f6253a354
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 9, 2026.

Transparency log

Release files / readablepdf-0.2.0-py3-none-any.whl

Download URL readablepdf-0.2.0-py3-none-any.whl
Size 5.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c94fd62276552b2bd51d2da177f94a3f27d24eca4c85604a1455f028a350fb99
BLAKE2b-256 checksum
How to use checksums
30ac3f964156ec064f4f9698bee5587d72b4d9cedf4b55a8358608e51c5c4c02
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 9, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page