Releases: yhay81/pylopdf
Release list
v0.10.0
v0.9.0
v0.8.0
v0.7.0
Positioned text extraction — the headline theme from the roadmap: pylopdf now covers rendering + positioned extraction + editing in one permissive-licensed package.
New extraction engine (hayro-based)
- Text extraction now interprets the page like the renderer does, assembling glyphs into reading order. Two long-standing limits disappeared: content streams with
%comments (lopdf#535) and non-embedded CJK fonts (90ms-RKSJ-H etc.) both extract correctly, and invisible text (OCR layers) is included Page.get_text("words" / "blocks" / "dict")— pymupdf-style positioned layout (bboxes, block/line/word numbers, spans with size + origin)Page.search_for(needle)— case-insensitive search returninglist[Rect], incl. CJK
Images & pixels
Page.get_images()— original JPEG bytes passed through unmodified (no recompression;[FlateDecode, DCTDecode]chains handled); CCITT / JBIG2 / stencils decoded to PNG; drawn bbox includedPage.get_pixmap(scale, dpi=, background=)— straight-alpha RGBA8Pixmap(samples/width/height/stride/tobytes()) for NumPy / PIL
Diagnostics
PylopdfWarning— font-resolution and image-decode failures reported by hayro surface as Python warnings
Full changelog: https://github.com/yhay81/pylopdf/blob/main/CHANGELOG.md
PyPI: https://pypi.org/project/pylopdf/0.7.0/
v0.6.0
Completes page manipulation and saving — the v0.6 theme from the roadmap.
Page objects
doc[i](negative indices, iteration) returns aPagewithrotation,mediabox/cropbox/rect(inheritance-resolved),get_text,render,render_svg- Structural changes invalidate stale pages with
StalePageError(pymupdf-style re-fetch semantics)
Page operations
insert_pdf(other, from_page=, to_page=, start_at=)— range merges, reversed ranges, insertion positionnew_page(),copy_page(), page duplication via repeated numbers inselect
TOC & encrypted saving
get_toc()/set_toc()with pymupdf-compatible[level, title, page]listssave/tobytesacceptuser_pw/owner_pw/permissionsand write AES-256 (PDF 2.0) output
Robustness & performance
- Typed exceptions:
PdfError(ValueError-compatible),PasswordError,DocumentClosedError,EncryptedDocumentError,StalePageError peek_metadata()fast probe,max_decompressed_size=bomb protection, render bounds- Heavy operations release the GIL (concurrent rendering measured ~1.9x on two threads); rendering caches the parsed document
render_page(dpi=, background=), save optionsgarbage=/deflate=/object_streams=
Full changelog: https://github.com/yhay81/pylopdf/blob/main/CHANGELOG.md
PyPI: https://pypi.org/project/pylopdf/0.6.0/
v0.5.0
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-compatibleneeds_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/
v0.4.1
First release available on PyPI: pip install pylopdf
Fixed
- Removed the invalid
Topic :: Text Processing :: Markup :: PDFclassifier that caused PyPI to reject the 0.4.0 upload; addedTyping :: Typed - Added a
validate-pyprojectpre-commit hook to catch invalid metadata earlier
See CHANGELOG.md for the full history including 0.2.0–0.4.0 (editing core on lopdf, rendering via hayro, pymupdf-style API).
v0.4.0
Note: The PyPI upload for this version was rejected due to an invalid trove classifier. Use v0.4.1 instead — it is the first version available on PyPI.
Added
Document.select(page_numbers)— keep/reorder pages (pymupdf-compatible)- CI workflow: rustfmt / clippy / ruff / mypy / pytest on Linux, macOS, and Windows
- Release workflow: abi3 wheels for manylinux (x86_64, aarch64), macOS (arm64, x86_64), and Windows (x64), published to PyPI via Trusted Publishing
- English README (
README.md); Japanese version moved toREADME.ja.md
Full Changelog: https://github.com/yhay81/pylopdf/blob/main/CHANGELOG.md
pylopdf-fonts-cjk 0.1.0
Data-only wheel with CJK (Japanese) fallback fonts for pylopdf: Noto Sans JP + Noto Serif JP (SIL OFL 1.1, from notofonts/noto-cjk).
Installed automatically via pip install pylopdf[cjk] and auto-detected by pylopdf >= 0.5.0 when rendering PDFs that reference non-embedded CJK fonts (e.g. MS-Mincho, Ryumin-Light).