Skip to content

Commit

Permalink
upload v1.19.6
Browse files Browse the repository at this point in the history
  • Loading branch information
JorjMcKie committed Mar 5, 2022
1 parent c5d7bad commit 2eaac63
Show file tree
Hide file tree
Showing 21 changed files with 1,387 additions and 867 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# PyMuPDF 1.19.5
# PyMuPDF 1.19.6

![logo](https://github.com/pymupdf/PyMuPDF/blob/master/demo/pymupdf.jpg)

Release date: February 01, 2022
Release date: March 3, 2022

On **[PyPI](https://pypi.org/project/PyMuPDF)** since August 2016: [![Downloads](https://static.pepy.tech/personalized-badge/pymupdf?period=total&units=international_system&left_color=black&right_color=orange&left_text=Downloads)](https://pepy.tech/project/pymupdf)

Expand All @@ -11,7 +11,7 @@ On **[PyPI](https://pypi.org/project/PyMuPDF)** since August 2016: [![Downloads]

# Introduction

PyMuPDF (current version 1.19.5) is a Python binding with support for [MuPDF](https://mupdf.com/) (current version 1.19.*), a lightweight PDF, XPS, and E-book viewer, renderer, and toolkit, which is maintained and developed by Artifex Software, Inc.
PyMuPDF (current version 1.19.6) is a Python binding with support for [MuPDF](https://mupdf.com/) (current version 1.19.*), a lightweight PDF, XPS, and E-book viewer, renderer, and toolkit, which is maintained and developed by Artifex Software, Inc.

MuPDF can access files in PDF, XPS, OpenXPS, CBZ, EPUB and FB2 (e-books) formats, and it is known for its top performance and high rendering quality.

Expand Down
27 changes: 26 additions & 1 deletion changes.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,31 @@
Change Log
===========

------

**Changes in Version 1.19.6**

* **Fixed** `#1620 <https://github.com/pymupdf/PyMuPDF/issues/1620>`_. The :ref:`TextPage` created by :meth:`Page.get_textpage` will now be freed correctly (removed memory leak).
* **Fixed** `#1601 <https://github.com/pymupdf/PyMuPDF/issues/1601>`_. Document open errors should now be more concise and easier to interpret. In the course of this, two PyMuPDF-specific Python exceptions have been **added:**

- ``EmptyFileError`` -- raised when trying to create a :ref:`Document` (``fitz.open()``) from an empty file or zero-length memory.
- ``FileDataError`` -- raised when MuPDF encounters irrecoverable document structure issues.

* **Added** :meth:`Page.load_widget` given a PDF field's xref.

* **Added** Dictionary :attr:`pdfcolor` which provide the about 500 colors defined as PDF color values with the lower case color name as key.

* **Added** algebra functionality to the :ref:`Quad` class. These objects can now also be added and subtracted among themselves, and be multiplied by numbers and matrices.

* **Added** new constants defining the default text extraction flags for more comfortable handling. Their naming convention is like :data:`TEXTFLAGS_WORDS` for ``page.get_text("words")``. See :ref:`text_extraction_flags`.

* **Changed** :meth:`Page.annots` and :meth:`Page.widgets` to detect and prevent reloading the page (illegally) inside the iterator loops via :meth:`Document.reload_page`. Doing this brings down the interpretor. Documented clean ways to do annotation and widget mass updates within properly designed loops.

* **Changed** several internal utility functions to become standalone ("SWIG inline") as opposed to be part of the :ref:`Tools` class. This, among other things, increases the performance of geometry object creation.

* **Changed** :meth:`Document.update_stream` to always accept stream updates - whether or not the dictionary object behind the xref already is a stream. Thus the former ``new`` parameter is now ignored and will be removed in v1.20.0.


------

**Changes in Version 1.19.5**
Expand Down Expand Up @@ -1352,7 +1377,7 @@ This version is also based on MuPDF v1.9a. Changes compared to version 1.9.1:

Type of memory area *stream* may be *bytes* or *bytearray*. Thus, e.g. *area = open("file.pdf", "rb").read()* may be used directly (without first converting it to bytearray).
* New method *Document.insert_pdf()* (PDFs only) inserts a range of pages from another PDF.
* *Document* objects doc now support the *len()* function: *len(doc) == doc.pageCount*.
* *Document* objects doc now support the *len()* function: ``len(doc) == doc.pageCount``.
* New method *Document.getPageImageList()* creates a list of images used on a page.
* New method *Document.getPageFontList()* creates a list of fonts referenced by a page.
* New pixmap constructor *fitz.Pixmap(doc, xref)* creates a pixmap based on an opened PDF document and an :data:`xref` number of the image.
Expand Down
17 changes: 9 additions & 8 deletions fitz/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,6 @@
fitz.recover_line_quad = fitz.utils.recover_line_quad
fitz.recover_span_quad = fitz.utils.recover_span_quad
fitz.recover_char_quad = fitz.utils.recover_char_quad
fitz.EMPTY_RECT = fitz.utils.EMPTY_RECT
fitz.EMPTY_IRECT = fitz.utils.EMPTY_IRECT
fitz.EMPTY_QUAD = fitz.utils.EMPTY_QUAD
fitz.INFINITE_RECT = fitz.utils.INFINITE_RECT
fitz.INFINITE_IRECT = fitz.utils.INFINITE_IRECT
fitz.INFINITE_QUAD = fitz.utils.INFINITE_QUAD

# ------------------------------------------------------------------------------
# Document
Expand Down Expand Up @@ -447,8 +441,15 @@ def deprecated_function(*args, **kw):
sys.version_info[0],
sys.version_info[1],
sys.platform,
64 if sys.maxsize > 2 ** 32 else 32,
64 if sys.maxsize > 2**32 else 32,
)

if VersionBind.startswith("1.19"): # don't generate aliases after this
if VersionBind.startswith("1.19"): # don't generate aliases after v1.19.*
restore_aliases()

pdfcolor = dict(
[
(k, (r / 255, g / 255, b / 255))
for k, (r, g, b) in fitz.utils.getColorInfoDict().items()
]
)
Loading

0 comments on commit 2eaac63

Please sign in to comment.