Editing-depth release. v0.2.0 widens the set of PDFs the engine can edit faithfully — password-protected documents, CID-keyed CFF/Type1C fonts, and CJK text — and hardens the honesty contract: anything the engine can't do cleanly is now surfaced as a typed Degradation (or refused) instead of silently corrupting output. DegradationKinds: 13 → 30. The public API is backward-compatible.
📦 pip install pdf-edit-engine==0.2.0 — https://pypi.org/project/pdf-edit-engine/0.2.0/
Added
- Edit encrypted PDFs end-to-end — opened, edited, and re-saved with encryption preserved (new
password=kwarg); honestencryption_droppedfallback when re-encryption isn't possible. - CID-keyed CFF / Type1C in-place glyph injection — Identity-H CIDFonts with CFF outlines (not just TrueType
glyf) can now be extended; collision-freeCID == GID, pre-existing CIDs never renumbered. - CJK / UAX#14 line-break — a spaceless CJK paragraph wider than its column now wraps at ideograph boundaries instead of silently overflowing; the Latin path is byte-identical.
- ToUnicode recovery — Type0/Identity-H fonts with no
/ToUnicodemap get their CID→Unicode recovered from the embedded cmap so text is locatable. - Opt-in shrink-to-fit (
fit="shrink") to fit text into a fixed-height region. - Honesty-taxonomy DX surface — root-level exports (
Degradation,DegradationKind,FONT_AFFECTING_KINDS,DEGRADATION_KINDS),FidelityReport.summary()/.is_clean/.max_severity/.warnings(), andEditResult.to_dict().
Fixed — silent corruptions now refused or surfaced
Multi-match same-operator collisions, content deletion (no more eaten neighbours), ligature integrity, rotated-text flattening, and reflow byte-stability — plus color, indent, and declared leading preserved through reflow.
Security
Graphics-state (q/Q) depth cap, font/CMap decompression-bomb guard, and linearization (Fast Web View) preservation on save.
Full details in the CHANGELOG.