overcuriousity/pdf2epub

Convert PDF files to nicely structured Markdown and EPUB format with intelligent layout detection using AI.

What it solves

PDFs are often difficult to convert to reflowable formats like EPUB or structured Markdown because they lack inherent structure. This tool converts PDF files into nicely structured Markdown and EPUB formats, specifically targeting books and academic papers.

How it works

The project uses a combination of AI-powered layout detection and text extraction. It leverages marker-pdf for the core PDF processing, transformers for text processing, and PyTorch for GPU acceleration (supporting NVIDIA, AMD, and Apple Silicon). It detects tables, extracts images, and preserves the document structure to create clean Markdown output, which is then converted into an EPUB file with customizable styling.

Who it’s for

Researchers, students, and ebook ownners who need to convert academic papers or books from PDF to a more readable, reflowable format for e-readers or further processing in Markdown.

Highlights

  • Smart Layout Detection: Specifically optimized for books and academic papers.
  • GPU Acceleration: Supports NVIDIA (CUDA), AMD (ROCm), and Apple Silicon (MPS) to speed up processing.
  • OCR and Table Handling: Includes advanced text extraction, OCR capabilities, and table formatting.
  • Multi-format Output: Generates both structured Markdown and EPUB files, including extracted images.
  • Multi-language Support: Capable of handling documents in multiple languages.

Related

  • Project
  • Project
  • Project
  • Project
  • Project