github oomol-lab/pdf-craft v1.0.3

latest releases: v2.6.7, v2.6.6, v2.6.5...
11 months ago

Release v1.0.3

What's Changed

License Improvements

  • Removed PyMuPDF (fitz) Dependency: Replaced PyMuPDF (AGPL-3.0) with Poppler for PDF parsing and rendering, maintaining pdf-craft's MIT license compatibility
    • pdf-craft now uses Poppler via pdf2image (MIT) for all PDF operations
    • This change ensures the entire project remains under the permissive MIT license

New Features

  • Custom PDF Handler Support: Added pdf_handler parameter to predownload_models(), transform_markdown(), and transform_epub() functions, allowing users to customize PDF rendering implementation
  • Poppler Integration: Migrated to Poppler (via pdf2image) for PDF parsing and rendering, providing better compatibility and control
  • New Public APIs: Exported PDFHandler, PDFDocument, DefaultPDFHandler, and DefaultPDFDocument for advanced customization
  • RENDERED Event: Added OCREventKind.RENDERED event to track PDF page rendering progress

Breaking Changes

⚠️ Parameter Renamed: ignore_fitz_errors → ignore_pdf_errors

  • Update your code: transform_markdown(..., ignore_pdf_errors=True) instead of ignore_fitz_errors=True
  • Update your code: transform_epub(..., ignore_pdf_errors=True) instead of ignore_fitz_errors=True

⚠️ Exception Renamed: FitzError → PDFError

  • Update your exception handling code accordingly

Dependencies

  • New Requirement: Poppler must be installed separately for PDF parsing
    • Ubuntu/Debian: sudo apt-get install poppler-utils
    • macOS: brew install poppler
    • Windows: Download from oschwartz10612/poppler-windows
    • See Installation Guide for details

Bug Fixes

  • Upgraded doc-page-extractor to fix bugs (#280)

Migration Guide

If you're upgrading from v1.0.2, please:

  1. Install Poppler following the Installation Guide
  2. Update parameter names in your code:
    # Before (v1.0.2)
    transform_markdown(..., ignore_fitz_errors=True)
    
    # After (v1.0.3)
    transform_markdown(..., ignore_pdf_errors=True)
  3. Update exception handling if you catch FitzError:
    # Before (v1.0.2)
    from pdf_craft import FitzError
    
    # After (v1.0.3)
    from pdf_craft import PDFError

Full Changelog

Full Changelog: v1.0.2...v1.0.3

Don't miss a new pdf-craft release

NewReleases is sending notifications on new releases.