Skip to content

Commit c207aaa

Browse files
committed
upload v1.18.3
1 parent 0e6be18 commit c207aaa

23 files changed

+1239
-281
lines changed

PKG-INFO

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Metadata-Version: 1.1
22
Name: PyMuPDF
3-
Version: 1.18.2
3+
Version: 1.18.3
44
Author: Jorj McKie
55
Author-email: [email protected]
66
Maintainer: Jorj McKie
@@ -9,7 +9,7 @@ Home-page: https://github.com/pymupdf/PyMuPDF
99
Download-url: https://github.com/pymupdf/PyMuPDF
1010
Summary: PyMuPDF is a Python binding for the PDF rendering library MuPDF
1111
Description:
12-
Release date: October 7, 2020
12+
Release date: November 9, 2020
1313

1414
Authors
1515
=======
@@ -20,7 +20,7 @@ Description:
2020
Introduction
2121
============
2222

23-
This is **version 1.18.2 of PyMuPDF**, a Python binding for `MuPDF <http://mupdf.com/>`_ - "a lightweight PDF and XPS viewer".
23+
This is **version 1.18.3 of PyMuPDF**, a Python binding for `MuPDF <http://mupdf.com/>`_ - "a lightweight PDF and XPS viewer".
2424

2525
MuPDF can access files in PDF, XPS, OpenXPS, epub, comic and fiction book formats, and it is known for both, its top performance and high rendering quality.
2626

README.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
1-
# PyMuPDF 1.18.2
1+
# PyMuPDF 1.18.3
22

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

5-
Release date: October 27, 2020
5+
Release date: November 9, 2020
66

77
**Travis-CI:** [![Build Status](https://travis-ci.org/JorjMcKie/py-mupdf.svg?branch=master)](https://travis-ci.org/JorjMcKie/py-mupdf)
88

9-
On **[PyPI](https://pypi.org/project/PyMuPDF)** since August 2016, [![](https://pepy.tech/badge/pymupdf)](https://pepy.tech/project/pymupdf)
9+
10+
On **[PyPI](https://pypi.org/project/PyMuPDF)** since August 2016: [![](https://pepy.tech/badge/pymupdf)](https://pepy.tech/project/pymupdf)
1011

1112
# Authors
1213
* [Jorj X. McKie](mailto:[email protected])
1314
* [Ruikai Liu](mailto:[email protected])
1415

1516
# Introduction
1617

17-
This is **version 1.18.2 of PyMuPDF**, a Python binding with support for [MuPDF 1.18.*](http://mupdf.com/) - "a lightweight PDF, XPS, and E-book viewer".
18+
This is **version 1.18.3 of PyMuPDF**, a Python binding with support for [MuPDF 1.18.*](http://mupdf.com/) - "a lightweight PDF, XPS, and E-book viewer".
1819

1920
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.
2021

@@ -30,7 +31,7 @@ For all supported document types (i.e. **_including images_**) you can
3031
* extract text and images
3132
* convert to other formats: PDF, (X)HTML, XML, JSON, text
3233

33-
> To some degree, PyMuPDF can therefore be used as an [image converter](https://github.com/pymupdf/PyMuPDF/wiki/How-to-Convert-Images): it can read a range of input formats, including SVG, and can produce **Portable Network Graphics (PNG)**, **Portable Anymaps** (**PNM**, etc.), **Portable Arbitrary Maps (PAM)**, **Scalable Vector Graphics (SVG)**, **Adobe Postscript** and **Adobe Photoshop** documents, making the use of other graphics packages obselete in these cases. But interfacing with e.g. PIL/Pillow for image input and output is easy as well.
34+
> To some degree, PyMuPDF can therefore be used as an [image converter](https://github.com/pymupdf/PyMuPDF/wiki/How-to-Convert-Images): it can read a range of input formats and can produce **Portable Network Graphics (PNG)**, **Portable Anymaps** (**PNM**, etc.), **Portable Arbitrary Maps (PAM)**, **Adobe Postscript** and **Adobe Photoshop** documents, making the use of other graphics packages obselete in these cases. But interfacing with e.g. PIL/Pillow for image input and output is easy as well.
3435
3536
For **PDF documents,** there exists a plethorea of additional features: they can be created, joined or split up. Pages can be inserted, deleted, re-arranged or modified in many ways (including annotations and form fields).
3637

docs/annot.rst

+16-2
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,26 @@ There is a parent-child relationship between an annotation and its page. If the
1515
**Attribute** **Short Description**
1616
=============================== ==============================================================
1717
:meth:`Annot.blendMode` return the annotation's blend mode
18-
:meth:`Annot.setBlendMode` set the annotation's blend mode
1918
:meth:`Annot.delete_responses` delete all responding annotions
2019
:meth:`Annot.fileGet` return attached file content
21-
:meth:`Annot.soundGet` return the sound of an audio annotation
2220
:meth:`Annot.fileInfo` return attached file information
2321
:meth:`Annot.fileUpd` set attached file new content
22+
:meth:`Annot.getOC` return xref of an optional content group
2423
:meth:`Annot.getPixmap` image of the annotation as a pixmap
2524
:meth:`Annot.getText` extract annotation text
2625
:meth:`Annot.getTextbox` extract annotation text
26+
:meth:`Annot.setBlendMode` set the annotation's blend mode
2727
:meth:`Annot.setBorder` change the border
2828
:meth:`Annot.setColors` change the colors
2929
:meth:`Annot.setFlags` change the flags
3030
:meth:`Annot.setInfo` change various properties
3131
:meth:`Annot.setLineEnds` set line ending styles
3232
:meth:`Annot.setName` change the "Name" field (e.g. icon name)
33+
:meth:`Annot.setOC` set visibility via an optional content group (OCG)
3334
:meth:`Annot.setOpacity` change transparency
3435
:meth:`Annot.setRect` change the rectangle
3536
:meth:`Annot.setRotation` change rotation
37+
:meth:`Annot.soundGet` return the sound of an audio annotation
3638
:meth:`Annot.update` apply accumulated annot changes
3739
:attr:`Annot.border` border details
3840
:attr:`Annot.colors` border / background and fill colors
@@ -141,6 +143,18 @@ There is a parent-child relationship between an annotation and its page. If the
141143
:arg int start: The symbol number for the first point.
142144
:arg int end: The symbol number for the last point.
143145

146+
.. method:: setOC(xref)
147+
148+
Set the annotation's visibility using optional content groups. This visibility can be controlled by user interfaces provided by supporting PDF viewers and is independent from other parameters like ::attr:`Annot.flags`.
149+
150+
:arg int xref: :data:`xref` of an optional contents group (OCG). If zero, any previous enty will be removed. An exception occurs if the xref does not point to a valid PDF object.
151+
152+
.. method:: getOC()
153+
154+
Return the :data:`xref` of an optional content group, or zero if there is none.
155+
156+
:returns: zero or the xref of an OCG (or OCMD).
157+
144158
.. method:: setOpacity(value)
145159

146160
Set the annotation's transparency. Opacity can also be set in :meth:`Annot.update`.

docs/app2.rst

+1
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ preserve ligatures 1 1 1 1 1 1 1 1
268268
preserve whitespace 1 1 1 1 1 1 1 1
269269
preserve images n/a 1 1 n/a 1 1 n/a 0
270270
inhibit spaces 0 0 0 0 0 0 0 0
271+
dehyphenate 0 0 0 0 0 0 0 0
271272
=================== ==== ==== ===== === ==== ======= ===== ======
272273

273274
* **"json"** is handled exactly like **"dict"** and is hence left out.

docs/changes.rst

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,22 @@
11
Change Logs
22
===============
33

4+
Changes in Version 1.18.3
5+
---------------------------
6+
As a major new feature, this version introduces support for PDF's **Optional Content** concept.
7+
8+
* **Fixed** issue `#714 <https://github.com/pymupdf/PyMuPDF/issues/714>`_.
9+
* **Fixed** issue `#711 <https://github.com/pymupdf/PyMuPDF/issues/711>`_.
10+
11+
* **Fixed** issue `#707 <https://github.com/pymupdf/PyMuPDF/issues/707>`_: if a PDF user password is supplied but no owner password is supplied nor present, then the user password is also used as the owner password.
12+
* **Fixed** ``expand`` and ``deflate`` parameters of methods :meth:`Document.save` and :meth:`Document.write`. Individual image and font compression should now finally work. Addresses issue `#713 <https://github.com/pymupdf/PyMuPDF/issues/713>`_.
13+
* **Added** a support of PDF optional content. This includes several new :ref:`Document` methods for inquiring and setting optional content status and adding optional content configurations and groups. In addition, images, form XObjects and annotations now can be bound to optional content specifications. **Resolved** issue `#709 <https://github.com/pymupdf/PyMuPDF/issues/709>`_.
14+
15+
16+
417
Changes in Version 1.18.2
518
---------------------------
6-
This version contains some interesting improvements for text searching: any number of search hits is now returned thanks to the removal of the **hit_max** parameter. The new **clip** parameter in addition allows to restrict the search area. Searching now detects hyphenations at line breaks and accordingly finds hyphenated words.
19+
This version contains some interesting improvements for text searching: any number of search hits is now returned and the **hit_max** parameter was removed. The new **clip** parameter in addition allows to restrict the search area. Searching now detects hyphenations at line breaks and accordingly finds hyphenated words.
720

821
* **Fixed** issue `#575 <https://github.com/pymupdf/PyMuPDF/issues/575>`_: if using ``quads=False`` in text searching, then overlapping rectangles on the same line are joined. Previously, parts of the search string, which belonged to different "marked content" items, each generated their own rectangle -- just as if occurring on separate lines.
922
* **Added** :attr:`Document.isRepaired`, which is true if the PDF was repaired on open.

docs/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
# built documents.
4141
#
4242
# The full version, including alpha/beta/rc tags.
43-
release = "1.18.2"
43+
release = "1.18.3"
4444

4545
# The short X.Y version
4646
version = release

docs/device.rst

-3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,3 @@ The different format handlers (pdf, xps, etc.) interpret pages to a "device". De
2828
:type textpage: :ref:`TextPage`
2929

3030
:arg int flags: control the way how text is parsed into the text page. Currently 3 options can be coded into this parameter, see :ref:`TextPreserve`. To set these options use something like *flags=0 | TEXT_PRESERVE_LIGATURES | ...*.
31-
32-
.. note:: In higher level code (:meth:`Page.getText`, :meth:`Document.getPageText`), the following decisions for creating text devices have been implemented: (1) *TEXT_PRESERVE_LIGATURES* and *TEXT_PRESERVE_WHITESPACES* are always set, (2) *TEXT_PRESERVE_IMAGES* is set for JSON and HTML, otherwise off.
33-

0 commit comments

Comments
 (0)