Skip to content

Commit 2eaac63

Browse files
committed
upload v1.19.6
1 parent c5d7bad commit 2eaac63

21 files changed

+1387
-867
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# PyMuPDF 1.19.5
1+
# PyMuPDF 1.19.6
22

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

5-
Release date: February 01, 2022
5+
Release date: March 3, 2022
66

77
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)
88

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

1212
# Introduction
1313

14-
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.
14+
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.
1515

1616
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.
1717

changes.txt

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,31 @@
11
Change Log
22
===========
33

4+
------
5+
6+
**Changes in Version 1.19.6**
7+
8+
* **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).
9+
* **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:**
10+
11+
- ``EmptyFileError`` -- raised when trying to create a :ref:`Document` (``fitz.open()``) from an empty file or zero-length memory.
12+
- ``FileDataError`` -- raised when MuPDF encounters irrecoverable document structure issues.
13+
14+
* **Added** :meth:`Page.load_widget` given a PDF field's xref.
15+
16+
* **Added** Dictionary :attr:`pdfcolor` which provide the about 500 colors defined as PDF color values with the lower case color name as key.
17+
18+
* **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.
19+
20+
* **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`.
21+
22+
* **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.
23+
24+
* **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.
25+
26+
* **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.
27+
28+
429
------
530

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

13531378
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).
13541379
* New method *Document.insert_pdf()* (PDFs only) inserts a range of pages from another PDF.
1355-
* *Document* objects doc now support the *len()* function: *len(doc) == doc.pageCount*.
1380+
* *Document* objects doc now support the *len()* function: ``len(doc) == doc.pageCount``.
13561381
* New method *Document.getPageImageList()* creates a list of images used on a page.
13571382
* New method *Document.getPageFontList()* creates a list of fonts referenced by a page.
13581383
* New pixmap constructor *fitz.Pixmap(doc, xref)* creates a pixmap based on an opened PDF document and an :data:`xref` number of the image.

fitz/__init__.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,6 @@
4242
fitz.recover_line_quad = fitz.utils.recover_line_quad
4343
fitz.recover_span_quad = fitz.utils.recover_span_quad
4444
fitz.recover_char_quad = fitz.utils.recover_char_quad
45-
fitz.EMPTY_RECT = fitz.utils.EMPTY_RECT
46-
fitz.EMPTY_IRECT = fitz.utils.EMPTY_IRECT
47-
fitz.EMPTY_QUAD = fitz.utils.EMPTY_QUAD
48-
fitz.INFINITE_RECT = fitz.utils.INFINITE_RECT
49-
fitz.INFINITE_IRECT = fitz.utils.INFINITE_IRECT
50-
fitz.INFINITE_QUAD = fitz.utils.INFINITE_QUAD
5145

5246
# ------------------------------------------------------------------------------
5347
# Document
@@ -447,8 +441,15 @@ def deprecated_function(*args, **kw):
447441
sys.version_info[0],
448442
sys.version_info[1],
449443
sys.platform,
450-
64 if sys.maxsize > 2 ** 32 else 32,
444+
64 if sys.maxsize > 2**32 else 32,
451445
)
452446

453-
if VersionBind.startswith("1.19"): # don't generate aliases after this
447+
if VersionBind.startswith("1.19"): # don't generate aliases after v1.19.*
454448
restore_aliases()
449+
450+
pdfcolor = dict(
451+
[
452+
(k, (r / 255, g / 255, b / 255))
453+
for k, (r, g, b) in fitz.utils.getColorInfoDict().items()
454+
]
455+
)

0 commit comments

Comments
 (0)