| Name | Modified | Size | Downloads / 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_assumedparameter to control TOC detection behavior (default:Truefor EPUB,Falsefor Markdown)
Implementation PRs:
- https://github.com/oomol-lab/pdf-craft/pull/297
- https://github.com/oomol-lab/pdf-craft/pull/298
- https://github.com/oomol-lab/pdf-craft/pull/299
- https://github.com/oomol-lab/pdf-craft/pull/300
- https://github.com/oomol-lab/pdf-craft/pull/301
- https://github.com/oomol-lab/pdf-craft/pull/302
- https://github.com/oomol-lab/pdf-craft/pull/303
π 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:
- https://github.com/oomol-lab/pdf-craft/pull/290
- https://github.com/oomol-lab/pdf-craft/pull/291
- https://github.com/oomol-lab/pdf-craft/pull/292
- https://github.com/oomol-lab/pdf-craft/pull/294
π 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
-
Fixed PIL crash on invalid bounding boxes: Added validation and normalization for layout bounding boxes to prevent crashes when cropping images with invalid coordinates (https://github.com/oomol-lab/pdf-craft/pull/295)
-
Fixed DeepSeek OCR center tag handling: Ignored alignment tags (
<center>,<left>,<right>) generated by DeepSeek OCR that aren't needed in the output (https://github.com/oomol-lab/pdf-craft/pull/307)
π§ Improvements
-
Refined layout joining logic: Improved paragraph merging across page boundaries with better handling of override assets and line continuation (https://github.com/oomol-lab/pdf-craft/pull/287, https://github.com/oomol-lab/pdf-craft/pull/288)
-
Updated dependencies:
- Upgraded
doc-page-extractorfrom 1.0.10 to 1.0.11 (https://github.com/oomol-lab/pdf-craft/pull/289) - Upgraded
epub-generatorfrom 0.1.2 to 0.1.5 -
Added
pyahocorasick2.2.0 for efficient substring matching -
CI/CD enhancements: Added merge-build workflow for automated builds on main branch pushes (https://github.com/oomol-lab/pdf-craft/pull/289)
π Documentation
- Updated README with new
toc_assumedparameter documentation (https://github.com/oomol-lab/pdf-craft/pull/304) - Refreshed documentation images with hosted assets
π API Changes
New Parameters
toc_assumedparameter intransform_markdown()andtransform_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:
Truefor EPUB,Falsefor 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