Skip to content

Releases: pymupdf/PyMuPDF

PyMuPDF-1.23.1 released

24 Aug 16:29
Compare
Choose a tag to compare

PyMuPDF-1.23.1 has been released.

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

python -m pip install --upgrade pymupdf

Changes in version 1.23.1 (2023-08-24)

  • Updated README and package summary description.

  • Fixed a problem on some Linux installations with Python-3.10
    (and possibly earlier versions) where import fitz failed with
    ImportError: libcrypt.so.2: cannot open shared object file: No such file or directory.

  • Fixed incompatible architecture error on MacOS arm64.

  • Fixed installation warning from Poetry about missing entry in wheels'
    RECORD files.

PyMuPDF-1.23.0 released

23 Aug 15:29
Compare
Choose a tag to compare

PyMuPDF-1.23.0 has been released.

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

python -m pip install --upgrade pymupdf

Changes in version 1.23.0 (2023-08-22)

  • Add method find_tables() to the Page object.

    This allows locating tables on any supported document page, and
    extracting table content by cell.

  • New "rebased" implementation of PyMuPDF.

    The rebased implementation is available as Python module
    fitz_new. It can be used as a drop-in replacement with import fitz_new as fitz.

  • Python-independent MuPDF libraries are now in a second wheel called
    PyMuPDFb that will be automatically installed by pip.

    This is to save space on pypi.org - a full release only needs one
    PyMuPDFb wheel for each OS.

  • Bug fixes:

  • Other changes:

    • Dropped support for Python-3.7.

    • Fix for wrong page / annot /Contents cleaning.

      We need to set pdf_filter_options::no_update to zero.

    • Added new function get_tessdata().

    • Cope with problem /Annot arrays.

      When copying page annotations in method Document.insert_pdf we
      previously did not check the validity of members of the /Annots
      array. For faulty members (like null or non-dictionary items) this
      could cause unnecessary exceptions. This fix implements more checks
      and skips such array items.

    • Additional annotation type checks.

      We did not previously check for annotation type when getting /
      setting annotation border properties. This is now checked in
      accordance with MuPDF.

    • Increase fault tolerance.

      Avoid exceptions in method insert_pdf() when source pages contains
      invalid items in the /Annots array.

    • Return empty border dict for applicable annots.

      We previously were returning a non-empty border dictionary even for
      non-applicable annotation types. We now return the empty dictionary
      {} in these cases. This requires some corresponding changes in the
      annotation .update() method, namely for dashes and border width.

    • Restrict set_rect to applicable annot types.

      We were insufficiently excluding non-applicable annotation types
      from set_rect() method. We now let MuPDF catch unsupported
      annotations and return False in these cases.

    • Wrong fontsize computation in page.get_texttrace().

      When computing the font size we were using the final text
      transformation matrix, where we should have taken span->trm
      instead. This is corrected here.

    • Updates to cope with changes to latest MuPDF.

      pdf_lookup_anchor() has been removed.

    • Update fill_textbox to better respect rect.width

      The function norm_words in fill_textbox had a bug in its last
      loop, appending n+1 characters when actually measuring width of n
      characters. It led to a bug in fill_texbox when you tried to write
      a single word mostly composed of "wide" letters (M,m, W, w...),
      causing the written text to exceed the given rect.

      The fix was just to replace n+1 by n.

    • Add script_focus and script_blur options to widget.

PyMuPDF-1.22.5 released

21 Jun 22:03
Compare
Choose a tag to compare

PyMuPDF-1.22.5 has been released.

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

python -m pip install --upgrade pymupdf

Changes in version 1.22.5 (2023-06-21)

  • This release uses MuPDF-1.22.2.

  • Bug fixes:

  • New features:

    • Changed Annotations now support "cloudy" borders.
      The :attr:Annot.border property has the new item clouds,
      and method :meth:Annot.set_border supports the corresponding clouds argument.

    • Changed Radio button widgets in the same RB group
      are now consistently updated if the group is defined in the standard way.

    • Added Support for the /Locked key in PDF Optional Content.
      This array inside the catalog entry /OCProperties can now be extracted and set.

    • Added Support for new parameter tessdata in OCR functions.
      New function :meth:get_tessdata locates the language support folder if Tesseract is installed.

PyMuPDF-1.22.3 released

11 May 06:26
Compare
Choose a tag to compare

PyMuPDF-1.22.3 has been released.

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

python -m pip install --upgrade pymupdf

Changes in version 1.22.3 (2023-05-10)

  • Bug fixes:

    • Fixed #2333: Unable to set any of button radio group in form

PyMuPDF-1.22.2 released

26 Apr 11:54
Compare
Choose a tag to compare

PyMuPDF-1.22.2 has been released.

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

python -m pip install --upgrade pymupdf

Changes in version 1.22.2 (2023-04-26)

  • This release uses MuPDF-1.22.0.

  • Bug fixes:

    • Fixed #2369: Image extraction bugs with newer versions

PyMuPDF-1.22.1 released

18 Apr 16:49
Compare
Choose a tag to compare

PyMuPDF-1.22.1 has been released.

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

python -m pip install --upgrade pymupdf

Changes in version 1.22.1 (2023-04-18)

  • This release uses MuPDF-1.22.0.

  • Bug fixes:

    • Fixed #2345: Turn off print statements in utils.py
    • Fixed #2348: extract_image returns an extension "flate" instead of "png"
    • Fixed #2350: Can not make widget (checkbox) to read-only by adding flags PDF_FIELD_IS_READ_ONLY
    • Fixed #2355: 1.22.0 error when using get_toc (AttributeError: 'SwigPyObject' object has no attribute)

PyMuPDF-1.22.0 released

14 Apr 17:55
Compare
Choose a tag to compare

PyMuPDF-1.22.0 has been released.

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

python -m pip install --upgrade pymupdf

Changes in version 1.22.0 (2023-04-14)

  • This release uses MuPDF-1.22.0.

  • Behavioural changes:

    • Text extraction now includes glyphs that overlap with clip rect; previously
      they were included only if they were entirely contained within the clip
      rect.
  • Bug fixes:

    • Fixed #1763: Interactive(smartform) form PDF calculation not working in pymupdf
    • Fixed #1995: RuntimeError: image is too high for a long paged pdf file when trying
    • Fixed #2093: Image in pdf changes color after applying redactions
    • Fixed #2108: Redaction removing more text than expected
    • Fixed #2141: Failed to read JPX header when trying to get blocks
    • Fixed #2144: Replace image throws an error
    • Fixed #2146: Wrong Handling of Reference Count of "None" Object
    • Fixed #2161: Support adding images as pages directly
    • Fixed #2168: page.add_highlight_annot(start=pointa, stop=pointb) not working
    • Fixed #2173: Double free of Colorspace used in Pixmap
    • Fixed #2179: Incorrect documentation for pixmap.tint_with()
    • Fixed #2208: Pushbutton widget appears as check box
    • Fixed #2210: apply_redactions() move pdf text to right after redaction
    • Fixed #2220: Page.delete_image() | object has no attribute is_image
    • Fixed #2228: open some pdf cost too much time
    • Fixed #2238: Bug - can not extract data from file in the newest version 1.21.1
    • Fixed #2242: Python quits silently in Story.element_positions() if callback function prototype is wrong
    • Fixed #2248: After redacting the content, the position of the remaining text changes
    • Fixed #2250: docs: unclear or broken link in page.rst
    • Fixed #2251: mupdf_display_errors does not apply to Pixmap when loading broken image
    • Fixed #2270: Annot.get_text("words") - doesn't return the first line of words
    • Fixed #2275: insert_image: document that rotations are counterclockwise
    • Fixed #2278: Can not make widget (checkbox) to read-only by adding flags PDF_FIELD_IS_READ_ONLY
    • Fixed #2290: Different image format/data from Page.get_text("dict") and Fitz.get_page_images()
    • Fixed #2293: 68 failed tests when installing from sdist on my box
    • Fixed #2300: Too much recursion in tree (parents), makes program terminate
    • Fixed #2322: add_highlight_annot using clip generates "A Number is Out of Range" error in PDF
  • Other:

    • Add key "/AS (Yes)" to the underlying annot object of a selected button form field.

    • Remove unused Document methods has_xref_streams() and
      has_old_style_xrefs() as MuPDF equivalents have been removed.

    • Add new Document methods and properties for getting/setting
      /PageMode, /PageLayout and /MarkInfo.

    • New Document property version_count, which contains the number of
      incremental saves plus one.

    • New Document property is_fast_webaccess which tells whether the
      document is linearized.

    • DocumentWriter is now a context manager.

    • Add support for Pixmap JPEG output.

    • Add support for drawing rectangles with rounded corners.

    • get_drawings(): added optional extended arg.

    • Fixed issue where trace devices' state was not being initialised
      correctly; data returned from things like fitz.Page.get_texttrace()
      might be slightly altered, e.g. linewidth values.

    • Output warning to stderr if it looks like we are being used with
      current directory containing an invalid fitz/ directory, because
      this can break import of fitz module. For example this happens
      if one attempts to use fitz when current directory is a PyMuPDF
      checkout.

  • Documentation:

    • General rework:

      • Introduces a new home page and new table of contents.
      • Structural update to include new About section.
      • Comparison & performance graphing.
      • Includes performance methodology in appendix.
      • Updates conf.py to understand single back-ticks as code.
      • Converts double back-ticks to single back-ticks.
      • Removes redundant files.
    • Improve insert_file() documentation.

    • get_bboxlog(): aded optional layers to get_bboxlog().

    • Page.get_texttrace(): add new dictionary key layer, name of Optional Content Group.

    • Mention use of Python venv in installation documentation.

    • Added missing fix for #2057 to release 1.21.1's changelog.

    • Fixes many links to the PyMuPDF-Utilities repo scripts.

    • Avoid duplication of changes.txt and docs/changes.rst.

  • Build

    • Added pyproject.toml file to improve builds using pip etc.

PyMuPDF-1.21.1 released

13 Dec 14:22
Compare
Choose a tag to compare

PyMuPDF-1.21.1 has been released.

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

python -m pip install --upgrade pymupdf

Changes in Version 1.21.1 (2022-12-13)

  • This release uses MuPDF-1.21.1.

  • Bug fixes:

    • Fixed #2110: Fully embedded font is extracted only partially if it occupies more than one object
    • Fixed #2094: Rectangle Detection Logic
    • Fixed #2088: Destination point not set for named links in toc
    • Fixed #2087: Image with Filter "[/FlateDecode/JPXDecode]" not extracted
    • Fixed #2086: Document.save() owner_pw & user_pw has buffer overflow bug
    • Fixed #2076: Segfault in fitz.py
    • Fixed #2051: Missing DPI Parameter
    • Fixed #2048: Invalid size of TextPage and bbox with newest version 1.21.0
    • Fixed #2045: SystemError: returned a result with an error set
    • Fixed #2039: 1.21.0 fails to build against system libmupdf
    • Fixed #2036: Archive::Archive defined twice
  • Other

    • Swallow "&zoom=nan" in link uri strings.
    • Add new Page utility methods Page.replace_image() and Page.delete_image().
  • Documentation:

    • #2040: Added note about test failure with non-default build of MuPDF, to tests/README.md.
    • #2037: In docs/installation.rst, mention incompatibility with chocolatey.org on Windows.
    • #2061: Fixed description of Annot.file_info.
    • #2065: Show how to insert internal PDF link.
    • Improved description of building from source without an sdist.
    • Added information about running tests.
    • #2084: Fixed broken link to PyMuPDF-Utilities.

PyMuPDF-1.21.0 released

08 Nov 15:08
Compare
Choose a tag to compare

PyMuPDF-1.21.0 has been released.

  • This release uses MuPDF-1.21.0.

  • New feature: Stories.

  • Added wheels for Python-3.11.

  • Bug fixes:

    • Fixed #1701: Broken custom image insertion.
    • Fixed #1854: Document.delete_pages() declines keyword arguments.
    • Fixed #1868: Access Violation Error at page.apply_redactions().
    • Fixed #1909: Adding text with fontname="Helvetica" can silently fail.
    • Fixed #1913: draw_rect(): does not respect width if color is not specified.
    • Fixed #1917: subset_fonts(): make it possible to silence the stdout.
    • Fixed #1936: Rectangle detection can be incorrect producing wrong output.
    • Fixed #1945: Segmentation fault when saving with clean=True.
    • Fixed #1965: pdfocr_save() Hard Crash.
    • Fixed #1971: Segmentation fault when using get_drawings().
    • Fixed #1946: block_no and block_type switched in get_text() docs.
    • Fixed #2013: AttributeError: 'Widget' object has no attribute '_annot' in delete widget.
  • Misc changes to core code:

    • Fixed various compiler warnings and a sequence-point bug.
    • Added support for Memento builds.
    • Fixed leaks detected by Memento in test suite.
    • Fixed handling of exceptions in set_name() and set_rect().
    • Allow build with latest MuPDF, for regular testing of PyMuPDF master.
    • Cope with new MuPDF exceptions when setting rect for some Annot types.
    • Reduced cosmetic differences between MuPDF's config.h and PyMuPDF's _config.h.
    • Cope with various changes to MuPDF API.
  • Other:

    • Fixed various broken links and typos in docs.
    • Mention install of swig-python on MacOS for #875.
    • Added (untested) wheels for macos-arm64.

Second release candidate for PyMuPDF-1.21.0: PyMuPDF-1.21.0rc2

07 Nov 21:41
Compare
Choose a tag to compare

This is largely unchanged from 1.21.0rc1, except that it builds with the official MuPDF-1.21.0 release.

Install with: python -m pip install pymupdf==1.21.0rc2