Skip to content

PyMuPDF-2.2 released

Latest

Choose a tag to compare

@julian-smith-artifex-com julian-smith-artifex-com released this 25 Nov 23:55
· 3 commits to main since this release

Wheels for Windows, Linux and MacOS, and the sdist, are available on
https://pypi.org and can be installed in the usual way, for example:

python -m pip install --upgrade pymupdf

Changes in version 2.2

Fixed issues:

New features:

  • Add extended FormFields Support.

Other:

  • Various small correctness fixes (from Abelardo Ramirez):

    • Archive.add(): fix broken assert (missing comma turned the error
      message into part of the boolean expression, disabling the empty-name
      check for binary content).
    • Annot.file_info: avoid UnboundLocalError when a crafted/malformed
      attachment's /FS dict has neither /UF nor /F.
    • Page.set_language(): call pdfpage.obj() instead of passing the bound
      method itself, which broke every call that actually sets a language.
    • Widget.on_state(): skip None entries from button_states() instead of
      raising TypeError.
    • Pixmap.tobytes(): add missing f-string prefix so the alpha error
      message actually includes the format name.
    • JM_matrix_from_py(): fix copy-paste bug returning FzRect() instead of
      FzMatrix() on the float-conversion failure path.
    • utils.get_text(): remove a bare assert that made the documented
      "misspelled option falls back to text" behavior unreachable.
    • utils.get_label_pno(): return "" (as documented) instead of raising
      IndexError when no label rule applies to the given page number.
    • utils.get_sorted_text(): guard against ZeroDivisionError for
      zero-width glyph bboxes.
    • _apply_pages.py (method='fork'): send the actual page numbers to
      workers instead of plain list indices, which silently processed the
      wrong pages for any non-contiguous/non-zero-based pages list.
    • table.chars_in_rect(): compare against c["top"]/c["bottom"] (top-down,
      matching the rect from page.get_drawings()) instead of c["y0"]/c["y1"]
      (PDF-native bottom-up space), fixing table detection for frames drawn
      as filled rectangles.
  • get_text: fail on unrecognized option instead of silently defaulting (from Abelardo Ramirez).

  • apply_pages(): Fix keyword forwarding in single-process page extraction (from JackyHsu-X).

  • Fixed sysinstall of mupdf with PYMUPDF_MUPDF_LIB (from Ben Moss).

  • Fix Document.convert_to_pdf() for page ranges that do not start at page 0 (from Athlex).

  • Some fixes for windows-x32.

  • Preserve line breaks and hyphens in clean table Markdown (from crunz-ai).

  • Fix table header boldness checks to use page coordinates (from crunz-ai).

  • Continue letter page labels with AA, BB, ... after Z, as the PDF spec says (from RavSinghChandan).

  • Added :meth:Page.search_for_fuzzy for edit-distance substring searches,
    returning matched text, distance and quads without additional dependencies.