Skip to content

v2.3.0

Choose a tag to compare

@github-actions github-actions released this 16 Sep 09:14
· 121 commits to main since this release
03c5ea9

PDF Craft v2.3.0

What's Changed

Richer PCEX document flow

  • Upgrade PCEX chapters to a v3 FlowItem-based document flow. A text flow now
    preserves its source fragments together with image/table assets anchored inside
    that flow, while display formulas remain explicit reading-flow boundaries.
  • Canonical writers now emit PCEX format v3. Readers retain migration support for
    v1 and v2 archives.
  • Render anchored images and tables in Markdown and EPUB in reading order. EPUB
    uses a conservative responsive float only when source geometry provides strong
    side-by-side evidence; otherwise assets remain normal block content.
  • Translate image/table title, content, and caption fields through a separate
    anchored-content stage, so they do not pollute NarrativeFlow translation context.

Page furniture and printed contents

  • Add ExtractionOptions.includes_furniture (default False) to opt into
    extraction of native PDF page furniture into furnitures.xml. It identifies
    recurring Universal and SameSide patterns, retains unmatched page-local
    sections, and supports common running heads, footers, and folios.
  • Add PDFCraft.translate_furnitures() and its FurnitureTransformer contract
    as a separate page-furniture translation stage. Translation coverage is
    recorded in translation.xml, allowing translated furniture to be patched
    back onto PDF pages without entering the main narrative translation flow.
  • Connect printed table-of-contents pages, body headings, and matching furniture
    sections through TOC identities so repeated chapter titles can share a
    translation.

More reliable PDF translation output

  • Refine two-stage PDF text fitting, including normalization for isolated
    single-line source boxes whose OCR height is not a reliable font-size signal.
  • Keep anchored image/table positions out of PDF text fitting: source text
    fragments in one TextFlowItem remain one continuous PDF text flow while the
    source artwork stays in the visual base.
  • Introduce read-only logical text projections for PCEX flows, shared by
    Narrative translation, PDF patching, Markdown, EPUB, and anchored-content
    context.
  • Preserve the canonical first-stage translation through XML fill. Fragment and
    anchor slots can no longer introduce visible spaces or split continuous text in
    PDF output, including cross-page fragment boundaries.

Optional OCR-derived book metadata

  • Add ExtractionOptions.extract_book_metadata (default False) and its
    required, independent metadata_llm to enable front-page OCR metadata
    extraction for PDF-to-EPUB and reusable PCEX workflows. The metadata agent
    begins with three OCR pages and may inspect up to twelve front pages when more
    evidence is needed.
  • Validate metadata JSON through the existing repair loop and retain only
    page-evidenced fields. Native PDF Info is used only to fill OCR-missing
    metadata.
  • Extend PCEX manifests with richer bibliographic metadata, including original
    names, publication details, subjects, and rights.

New public PCEX operations and members

  • Add PDFCraft.translate_anchored_contents() and its
    AnchoredContentTransformer contract for a separate image/table text
    translation stage.
  • PCEX v3 archives can contain optional furnitures.xml and translation.xml
    members. The latter records translated / preserved coverage for Narrative,
    furniture, and extracted image/table text, so a PDF patch only replaces text
    that has actually been translated.
  • The expanded manifest.json document object now records original_title,
    structured author original_name / nationality, publication_date,
    edition, subjects, and rights.

Documentation

  • Refresh English and Chinese PDF translation and PCEX documentation.
  • Add localized README files and updated product screenshots.

Breaking change

  • Remove callback-based PDF translation (Callable[[str], str]). Translate a
    PCEX with a structured chapter transformer, then patch the resulting extraction
    with PDFCraft.patch_pdf_with_extraction(); PDFCraft.translate_pdf() now
    accepts only a structured chapter transformer.

Selected Pull Requests

Full Changelog: v2.2.1...v2.3.0