Skip to content

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/