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/