Download Latest Version v2.6.7 source code.zip (25.8 MB)
Home / v1.0.4
Name Modified Size InfoDownloads / Week
Parent folder
README.md 2025-12-19 5.2 kB
v1.0.4 source code.tar.gz 2025-12-19 14.6 MB
v1.0.4 source code.zip 2025-12-19 14.7 MB
Totals: 3 Items   29.3 MB 0

Release v1.0.4

What's New

🎯 Table of Contents Detection and Smart Removal

pdf-craft now automatically detects and removes table of contents pages from the final output, preventing duplicate TOC content in generated EPUB files. The system uses statistical analysis to identify TOC pages by matching chapter titles against page content, then intelligently excludes these pages while preserving the navigation structure.

Related: https://github.com/oomol-lab/pdf-craft/issues/268

Key features:

  • Automatic TOC page detection using Aho-Corasick substring matching
  • Hierarchical TOC level analysis for improved chapter organization
  • XML-based TOC storage for better performance and flexibility
  • New toc_assumed parameter to control TOC detection behavior (default: True for EPUB, False for Markdown)

Implementation PRs:

πŸ“ Raw HTML Tag Support in Markdown

Full support for CommonMark-compliant raw HTML tags in Markdown output. DeepSeek OCR often generates HTML tags (like <sup> for superscripts) when processing scanned books - these are now properly preserved and rendered in both Markdown and EPUB formats.

Related: https://github.com/oomol-lab/pdf-craft/issues/283

Supported tags include:

  • Inline tags: <sup>, <sub>, <mark>, <u>, <kbd>
  • Block-level tags: <div>, <center>, <details>, <summary>
  • Automatic safety filtering and attribute validation

Implementation PRs:

πŸ“Š Enhanced Table Rendering

Tables are now rendered in native HTML format for both Markdown and EPUB outputs, providing better structure and readability. Asset metadata now supports structured titles and captions for equations, images, and tables.

https://github.com/oomol-lab/pdf-craft/pull/306

πŸ“– PDF Metadata Extraction

Automatically extracts book metadata (title, authors, publisher, ISBN, etc.) from PDF files and uses it to populate EPUB metadata. No need to manually specify book information when the PDF already contains it.

https://github.com/oomol-lab/pdf-craft/pull/284

πŸ“° Multi-Column Layout Detection

Improved handling of multi-column layouts (common in academic papers and magazines) through histogram valley detection and coefficient-of-variation splitting. Layouts are now correctly grouped by column segments before processing.

https://github.com/oomol-lab/pdf-craft/pull/286

πŸ› Bug Fixes

πŸ”§ Improvements

πŸ“š Documentation

πŸ”„ API Changes

New Parameters

  • toc_assumed parameter in transform_markdown() and transform_epub():
  • When True: Attempts to locate and extract TOC from PDF to build document structure
  • When False: Generates TOC based on document headings only
  • Default: True for EPUB, False for Markdown

New Exports

  • PDFDocumentMetadata: Dataclass for PDF metadata extraction

πŸ™ Contributors

Thanks to everyone who contributed to this release!

πŸ“¦ Installation

:::bash
pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
pip install pdf-craft==1.0.4

For detailed installation instructions, see the Installation Guide.


Full Changelog: https://github.com/oomol-lab/pdf-craft/compare/v1.0.3...v1.0.4

Source: README.md, updated 2025-12-19