Skip to content

Latest commit

 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

scan2epub

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.

Setup

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]"

Usage

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 8

If -o is omitted, the EPUB is written to out/<pdf-stem>.epub.

OCR modes

  • auto (default) — use embedded text; OCR only short or empty pages
  • always — OCR every page
  • never — never call Tesseract; skip empty pages

Development

pytest

About

Convert scanned PDFs into reflowable EPUBs

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages