Skip to content

Releases: yhay81/pylopdf

v0.10.0

Choose a tag to compare

@github-actions github-actions released this 25 Jul 03:17
Immutable release. Only release title and notes can be modified.
v0.10.0
48c3b73

What's Changed

Full Changelog: v0.9.0...v0.10.0

v0.9.0

Choose a tag to compare

@yhay81 yhay81 released this 24 Jul 07:33
v0.9.0
44f4ddb

Full Changelog: v0.8.0...v0.9.0

v0.8.0

Choose a tag to compare

@yhay81 yhay81 released this 24 Jul 07:32
v0.8.0
4cec3fc

Full Changelog: v0.7.0...v0.8.0

v0.7.0

Choose a tag to compare

@yhay81 yhay81 released this 22 Jul 20:19
v0.7.0
35811ed

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 returning list[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 included
  • Page.get_pixmap(scale, dpi=, background=) — straight-alpha RGBA8 Pixmap (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

Choose a tag to compare

@yhay81 yhay81 released this 22 Jul 16:34
v0.6.0
dee50a8

Completes page manipulation and saving — the v0.6 theme from the roadmap.

Page objects

  • doc[i] (negative indices, iteration) returns a Page with rotation, 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 position
  • new_page(), copy_page(), page duplication via repeated numbers in select

TOC & encrypted saving

  • get_toc() / set_toc() with pymupdf-compatible [level, title, page] lists
  • save / tobytes accept user_pw / owner_pw / permissions and 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 options garbage= / 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

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/

v0.4.1

Choose a tag to compare

@yhay81 yhay81 released this 22 Jul 07:21
v0.4.1
0f12761

First release available on PyPI: pip install pylopdf

Fixed

  • Removed the invalid Topic :: Text Processing :: Markup :: PDF classifier that caused PyPI to reject the 0.4.0 upload; added Typing :: Typed
  • Added a validate-pyproject pre-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).

PyPI: https://pypi.org/project/pylopdf/0.4.1/

v0.4.0

Choose a tag to compare

@yhay81 yhay81 released this 22 Jul 07:21
v0.4.0
ee4bfc8

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 to README.ja.md

Full Changelog: https://github.com/yhay81/pylopdf/blob/main/CHANGELOG.md

pylopdf-fonts-cjk 0.1.0

Choose a tag to compare

@yhay81 yhay81 released this 22 Jul 12:01
fonts-v0.1.0
c7962d7

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).

PyPI: https://pypi.org/project/pylopdf-fonts-cjk/0.1.0/