Convert scanned (image) PDFs into reflowable EPUBs.
The converter prefers text already embedded in the PDF (typical for Internet Archive scans). Pages with little or no text are OCR’d with the local Tesseract install.
Requires Python 3.11+ and Tesseract on PATH (used only when a page needs OCR).
python3.12 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"scan2epub convert "/path/to/book.pdf" -o "/path/to/book.epub"
scan2epub convert book.pdf -o book.epub --title "..." --author "..." --lang en
scan2epub convert book.pdf -o book.epub --ocr always
scan2epub convert book.pdf -o book.epub --jobs 8If -o is omitted, the EPUB is written to out/<pdf-stem>.epub.
auto(default) — use embedded text; OCR only short or empty pagesalways— OCR every pagenever— never call Tesseract; skip empty pages
pytest