Skip to main content
Back

oomol-lab's pdf-craft Turns Scanned PDFs Into Readable Text Locally

pdf-craft turns scanned book PDFs into clean Markdown or EPUB files entirely offline, powered by DeepSeek OCR running locally on your GPU

Repo, Full Access
  • What it is: pdf-craft is an open-source Python library that converts scanned book PDFs into clean Markdown or EPUB, fully offline.
  • Core engine: Powered by DeepSeek OCR, which uses vision-text compression rather than traditional character recognition, achieving competitive scores on OmniDocBench.
  • Key capability: Automatically strips headers, footers, and page numbers; preserves footnotes, tables, formulas, and cross-page paragraph continuity.
  • v1.0 shift: Dropped LLM-based text correction (and its AGPL license) in favor of fully local DeepSeek OCR inference under MIT license.
  • Five model sizes: From tiny (fast/lower quality) to gundam (default, highest quality); optional LLM hook for complex TOC extraction.
  • Online option: Inkora offers a no-setup browser version with additional features like ebook translation and audiobook generation.

pdf-craft is an open-source Python library that solves one of the most frustrating document problems in existence: you have a scanned book PDF, and you want to actually read or work with its contents. Not stare at flat images. Not fight with garbled copy-paste. Real, searchable, reflowable text. The library converts those image-based PDFs into structured Markdown or EPUB files, fully locally, with no cloud dependency.

With GPU acceleration, pdf-craft completes the entire conversion process from PDF to Markdown or EPUB locally, automatically identifying document structure, accurately extracting body text, and filtering out interfering elements like headers and footers. The project has accumulated nearly 5,900 GitHub stars since its launch, with over 400 forks, signaling real traction in the developer and research community.

The problem it actually solves

Scanned PDFs are essentially photographs of pages. Standard PDF text extraction tools fail completely on them because there is no embedded text layer to extract. Traditional OCR tools can recover raw characters, but they typically destroy document structure: page numbers bleed into sentences, multi-column layouts get scrambled, footnotes appear mid-paragraph, and chapter headings are indistinguishable from body text.

For academic or technical documents containing footnotes, formulas, and tables, pdf-craft handles them properly, preserving these important elements, including images and other assets within footnotes. That last part matters more than it sounds: a footnote in a philosophy text or a math textbook can contain entire arguments or derivations.

How it works under the hood

pdf-craft transforms image-based PDF pages into semantically structured content through a multi-stage pipeline: PDF rendering converts pages to high-resolution images; OCR recognition extracts text, layout, and elements using DeepSeek OCR models; structure analysis detects document hierarchy, table of contents, and references; content assembly merges paragraphs across pages and attaches captions to assets; and format generation renders the final Markdown or EPUB files.