| Name | Modified | Size | Downloads / 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.epubcfiis nowstr | None. Field order remainsepubcfi,original,translated, andEpubTranslationremains an alias. Callers should check forNonebefore using a location; source and translated plain text are still delivered normally.- Supported
text/htmlcontent and fragments with explicitly unavailable source-location information receiveepubcfi=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