Download Latest Version v2.6.7 source code.zip (25.8 MB)
Home / v2.5.1
Name Modified Size InfoDownloads / Week
Parent folder
pdf_craft-2.5.1-py3-none-any.whl 2026-10-21 425.0 kB
pdf_craft-2.5.1-py3-none-any.whl.publish.attestation 2026-10-21 9.5 kB
pdf_craft-2.5.1.tar.gz 2026-10-21 349.0 kB
pdf_craft-2.5.1.tar.gz.publish.attestation 2026-10-21 9.4 kB
README.md 2026-10-21 2.1 kB
v2.5.1 source code.tar.gz 2026-10-21 23.7 MB
v2.5.1 source code.zip 2026-10-21 23.9 MB
Totals: 7 Items   48.4 MB 0

PDF Craft v2.5.1

PDF Craft 2.5.1 fixes EPUB translation previews for text/html spine documents. Enabling translate_epub(on_body=...) now keeps text callbacks available when a reliable source CFI cannot be generated, instead of failing an otherwise supported translation.

Optional EPUB fragment locations

  • EpubFragmentContent.epubcfi is now str | None. Field order remains epubcfi, original, translated, and EpubTranslation remains an alias. Callers should check for None before using a location; source and translated plain text are still delivered normally.
  • Supported text/html content and fragments with explicitly unavailable source-location information receive epubcfi=None. No guessed CFI is emitted. XHTML fragments retain their precise source locations, including in EPUBs that mix HTML and XHTML documents.
  • Callbacks retain atomic-fragment granularity and source order. Document-head titles, navigation and book metadata are not added to body callbacks. Both SDK facades support synchronous or asynchronous callbacks and await async callbacks.
  • Only known location unavailability is downgraded. Actual parsing and translation failures, unexpected source-mapping or offset errors, and user callback exceptions still abort the operation. Cancellation and existing-output protection remain unchanged.

Coverage and documentation

Regression tests cover HTML callbacks in all three submission modes, mixed HTML/XHTML location preservation, missing package locations, synchronous callback awaiting, absent-callback costs, and error/cancellation propagation. The full suite passes 930 tests; type checking, lint and 2.5.1 package builds also pass.

The English callback guide, Chinese callback guide, API references and EPUB translation guides document the nullable field and its error-handling boundary. Existing PCEX formats, PDF callbacks and EPUB writeback modes are unchanged.

See #519.

Full Changelog: https://github.com/oomol-lab/pdf-craft/compare/v2.5.0...v2.5.1

Source: README.md, updated 2026-10-21