Skip to content

v0.5.0

Choose a tag to compare

@yhay81 yhay81 released this 22 Jul 12:10
v0.5.0
d2ad0b2

Two major features: encrypted PDF reading and CJK fallback fonts for rendering Japanese PDFs without embedded fonts.

Encrypted PDFs

  • pylopdf.open(path, password=...), plus pymupdf-compatible needs_pass / is_encrypted / authenticate(password) (returns 0/1/2/4/6)
  • Supports RC4-40/128, AES-128, AES-256 (R6); PDFs with an empty user password (permission-only protection) keep opening transparently
  • Operating on a still-encrypted document raises a clear error instead of silently appearing empty
  • Zero wheel-size cost (lopdf links its crypto unconditionally)

CJK rendering (pip install pylopdf[cjk])

  • New optional extra installs pylopdf-fonts-cjk (Noto Sans/Serif JP, SIL OFL 1.1), auto-detected at render time
  • PDFs referencing non-embedded CJK fonts (MS-Mincho, Ryumin-Light, MS-Gothic, …) now render; Mincho-like names pick the serif face
  • Or bring your own font: doc.set_fallback_font(path_or_bytes, kind="sans"|"serif", index=0)

Also

  • Real-world PDF regression corpus (tests/assets/real_world/) + encrypted fixtures
  • Documented lopdf limits via strict xfail (text extraction fails on % comments inside content streams)

Full changelog: https://github.com/yhay81/pylopdf/blob/main/CHANGELOG.md
PyPI: https://pypi.org/project/pylopdf/0.5.0/