Skip to content

Commit 363db51

Browse files
committed
upload v1.17.1
1 parent f922849 commit 363db51

23 files changed

+1400
-853
lines changed

PKG-INFO

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Metadata-Version: 1.1
22
Name: PyMuPDF
3-
Version: 1.17.0
3+
Version: 1.17.1
44
Author: Ruikai Liu
55
Author-email: [email protected]
66
Maintainer: Jorj X. 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: May 18, 2020
12+
Release date: June 20, 2020
1313

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

23-
This is **version 1.17.0 of PyMuPDF**, a Python binding for `MuPDF <http://mupdf.com/>`_ - "a lightweight PDF and XPS viewer".
23+
This is **version 1.17.1 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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# PyMuPDF 1.17.0
1+
# PyMuPDF 1.17.1
22

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

5-
Release date: May 18, 2020
5+
Release date: June 20, 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

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

1515
# Introduction
1616

17-
This is **version 1.17.0 of PyMuPDF (formerly python-fitz)**, a Python binding with support for [MuPDF 1.17.*](http://mupdf.com/) - "a lightweight PDF, XPS, and E-book viewer".
17+
This is **version 1.17.1 of PyMuPDF**, a Python binding with support for [MuPDF 1.17.*](http://mupdf.com/) - "a lightweight PDF, XPS, and E-book viewer".
1818

1919
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.
2020

@@ -52,7 +52,7 @@ Have a look at the basic [demos](https://github.com/pymupdf/PyMuPDF-Utilities/tr
5252

5353
Our **documentation**, written using Sphinx, is available in various formats from the following sources. It currently is a combination of a reference guide and a user manual. For a **quick start** look at the [tutorial](https://pymupdf.readthedocs.io/en/latest/tutorial/) and the [recipes](https://pymupdf.readthedocs.io/en/latest/faq/) chapters.
5454

55-
* You can view it online at [Read the Docs](https://pymupdf.readthedocs.io/). This site also provides download options for zipped HTML and PDF.
55+
* You can view it online at [Read the Docs](https://readthedocs.org/projects/pymupdf/). This site also provides download options for zipped HTML and PDF.
5656
* Find a Windows help file [here](https://github.com/pymupdf/PyMuPDF-optional-material/tree/master/doc/PyMuPDF.chm).
5757

5858

docs/annot.rst

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ There is a parent-child relationship between an annotation and its page. If the
2626
:meth:`Annot.setFlags` change the flags
2727
:meth:`Annot.setInfo` change various properties
2828
:meth:`Annot.setLineEnds` set line ending styles
29-
:meth:`Annot.setOpacity` change transparency
3029
:meth:`Annot.setName` change the "Name" field (e.g. icon name)
30+
:meth:`Annot.setOpacity` change transparency
3131
:meth:`Annot.setRect` change the rectangle
32+
:meth:`Annot.setRotation` change rotation
3233
:meth:`Annot.update` apply accumulated annot changes
3334
:attr:`Annot.border` border details
3435
:attr:`Annot.colors` border / background and fill colors
@@ -140,6 +141,21 @@ There is a parent-child relationship between an annotation and its page. If the
140141

141142
:arg rect_like rect: the new rectangle of the annotation (finite and not empty). E.g. using a value of *annot.rect + (5, 5, 5, 5)* will shift the annot position 5 pixels to the right and downwards.
142143

144+
.. note:: You need not invoke :meth:`Annot.update` for activation of the effect.
145+
146+
147+
.. method:: setRotation(angle)
148+
149+
Set the rotation of an annotation. This rotates the annotation rectangle around its center point. Then a **new rectangle** is calculated which replaces the existing one.
150+
151+
:arg int angle: rotation angle in degrees. Arbitrary values are possible, but will be replaced by equivalent values 0 <= angle < 360.
152+
153+
.. note::
154+
* You **must invoke** :meth:`Annot.update` to activate the effect.
155+
* For PDF_ANNOT_FREE_TEXT, only the four values 0, 90, 180 and 270 are possible and will only **rotate the text** inside the current rectangle (which remains unchanged). Other values are silently ignored and treated as 0.
156+
* Otherwise, only the following `AnnotationTypes`_ can be rotated: 'Square', 'Circle', 'Caret', 'Text', 'FileAttachment', 'Ink', 'Line', 'Polyline', 'Polygon', and 'Stamp'. For all others the method is a no-op.
157+
158+
143159
.. method:: setBorder(border=None, width=0, style=None, dashes=None)
144160

145161
PDF only: Change border width and dashing properties.
@@ -191,9 +207,9 @@ There is a parent-child relationship between an annotation and its page. If the
191207
* :meth:`setRect`
192208
* :meth:`setFlags`
193209
* :meth:`fileUpd`
194-
* :meth:`setInfo` (except changes to *"content"*)
210+
* :meth:`setInfo` (except any changes to *"content"*)
195211

196-
All arguments are optional. *(Changed in v1.16.14)* Blend mode and opacity are applicable to all annotation types. The other arguments are mostly special use, as described below.
212+
All arguments are optional. *(Changed in v1.16.14)* Blend mode and opacity are applicable to **all annotation types**. The other arguments are mostly special use, as described below.
197213

198214
Color specifications may be made in the usual format used in PuMuPDF as sequences of floats ranging from 0.0 to 1.0 (including both). The sequence length must be 1, 3 or 4 (supporting GRAY, RGB and CMYK colorspaces respectively). For mono-color, just a float is also acceptable and yields some shade of gray.
199215

@@ -205,9 +221,9 @@ There is a parent-child relationship between an annotation and its page. If the
205221
:arg sequence,float fill_color: the fill color.
206222

207223
* 'FreeText' annotations: If you set (or leave) this to *None*, then **no rectangle at all** will be drawn around the text, and the border color will be ignored. This will leave anything "under" the text visible.
208-
* 'Line', 'Polyline', 'Polygon' annotations: use it for line end symbols to give them a fill color other than the one of the annotation *(changed in v1.16.16)*
224+
* 'Line', 'Polyline', 'Polygon' annotations: use it to give applicable line end symbols a fill color other than that of the annotation *(changed in v1.16.16)*.
209225

210-
:arg int rotate: new rotation value. Default (-1) means no change. 'FreeText' annotations only.
226+
:arg int rotate: new rotation value. Default (-1) means no change. Supports 'FreeText' and several other annotation types (see `Annot.setRotation`), [#f1]_. Only choose 0, 90, 180, or 270 degrees for 'FreeText'. Otherwise any integer is acceptable.
211227

212228
:rtype: bool
213229

@@ -258,6 +274,13 @@ There is a parent-child relationship between an annotation and its page. If the
258274

259275
:rtype: :ref:`Page`
260276

277+
.. attribute:: rotation
278+
279+
The annot rotation.
280+
281+
:rtype: int
282+
:returns: a value [-1, 359]. If rotation is not at all, -1 is returned (and implies a rotation angle of 0). Other possible values are normalized to some value value 0 <= angle < 360.
283+
261284
.. attribute:: rect
262285

263286
The rectangle containing the annotation.
@@ -387,3 +410,7 @@ This is how the circle annotation looks like before and after the change (pop-up
387410

388411
.. |circle| image:: images/img-circle.png
389412

413+
414+
.. rubric:: Footnotes
415+
416+
.. [#f1] Rotating an annotation generally also changes its rectangle. Depending on how the annotation was defined, the original rectangle in general is **not reconstructible** by setting the rotation value to zero. This information may be lost.

docs/app4.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Adobe PDF References
5454

5555
This PDF Reference manual published by Adobe is frequently quoted throughout this documentation. It can be viewed and downloaded from `here <http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/pdf_reference_1-7.pdf>`_.
5656

57-
There is a newer version of this, which be found `here <https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/PDF32000_2008.pdf>`_. Redaction annotation are an example, which is contained in this one, but not in the earlier version.
57+
There is a newer version of this, which can be found `here <https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/PDF32000_2008.pdf>`_. Redaction annotations are an example contained in this one, but not in the earlier version.
5858

5959
------------
6060

docs/changes.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
Change Logs
22
===============
33

4+
Changes in Version 1.17.1
5+
---------------------------
6+
* **Fixed** issue `#520 <https://github.com/pymupdf/PyMuPDF/issues/520>`_.
7+
* **Fixed** issue `#525 <https://github.com/pymupdf/PyMuPDF/issues/525>`_. Vertices for 'Ink' annots should now be correct.
8+
* **Fixed** issue `#524 <https://github.com/pymupdf/PyMuPDF/issues/524>`_. It is now possible to query and set rotation for applicable annotation types.
9+
10+
Also significantly improved inline documentation for better support of interactive help.
11+
412
Changes in Version 1.17.0
513
---------------------------
614
This version is based on MuPDF v1.17. Following are highlights of new and changed features:

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
# built documents.
4747
#
4848
# The full version, including alpha/beta/rc tags.
49-
release = "1.17.0"
49+
release = "1.17.1"
5050

5151
# The short X.Y version
5252
version = release

docs/functions.rst

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
============
22
Functions
33
============
4-
The following are miscellaneous functions on a fairly low-level technical detail.
4+
The following are miscellaneous functions and attributes on a fairly low-level technical detail.
55

6-
Some functions provide detail access to PDF structures. Others are stripped-down, high performance versions of functions providing more information.
6+
Some functions provide detail access to PDF structures. Others are stripped-down, high performance versions of other functions which provide more information.
77

88
Yet others are handy, general-purpose utilities.
99

1010

1111
==================================== ==============================================================
1212
**Function** **Short Description**
1313
==================================== ==============================================================
14-
:attr:`Document.FontInfos` PDF only: information on inserted fonts
1514
:meth:`Annot._cleanContents` PDF only: clean the annot's :data:`contents` objects
15+
:meth:`Annot.setAPNMatrix` PDF only: set the matrix of the appearance object
16+
:meth:`Annot.setAPNMatrix` PDF only: set the matrix of the appearance object
17+
:attr:`Annot.APNMattrix` PDF only: the matrix of the appearance object
18+
:attr:`Annot.APNBBox` PDF only: bbox of the appearance object
1619
:meth:`ConversionHeader` return header string for *getText* methods
1720
:meth:`ConversionTrailer` return trailer string for *getText* methods
1821
:meth:`Document._delXmlMetadata` PDF only: remove XML metadata
@@ -34,13 +37,14 @@ Yet others are handy, general-purpose utilities.
3437
:meth:`Document.extractImage` PDF only: extract embedded image
3538
:meth:`Document.getCharWidths` PDF only: return a list of glyph widths of a font
3639
:meth:`Document.isStream` PDF only: check whether an :data:`xref` is a stream object
40+
:attr:`Document.FontInfos` PDF only: information on inserted fonts
3741
:meth:`ImageProperties` return a dictionary of basic image properties
3842
:meth:`getPDFnow` return the current timestamp in PDF format
3943
:meth:`getPDFstr` return PDF-compatible string
4044
:meth:`getTextlength` return string length for a given font & fontsize
4145
:meth:`Page._cleanContents` PDF only: clean the page's :data:`contents` objects
4246
:meth:`Page._getContents` PDF only: return a list of content numbers
43-
:meth:`Page._setContents` PDF only: set page's :data:`contents` object to specified :data:`xref`
47+
:meth:`Page._setContents` PDF only: set page's :data:`contents` to some :data:`xref`
4448
:meth:`Page.getDisplayList` create the page's display list
4549
:meth:`Page.getTextBlocks` extract text blocks as a Python list
4650
:meth:`Page.getTextWords` extract text words as a Python list

docs/images/img-redact-2.jpg

-28.2 KB
Binary file not shown.

docs/irect.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,13 @@ IRect is a rectangular bounding box similar to :ref:`Rect`, except that all corn
9393

9494
:rtype: bool
9595

96-
.. method:: morph(pivot, matrix)
96+
.. method:: morph(fixpoint, matrix)
9797

9898
*(New in version 1.17.0)*
9999

100-
Return a new quad after applying a matrix to it using a pivotal point.
100+
Return a new quad after applying a matrix to it using a fixed point.
101101

102-
:arg point_like pivot: the pivotal point.
102+
:arg point_like fixpoint: the fixed point.
103103
:arg matrix_like matrix: the matrix.
104104
:returns: a new :ref:`Quad`. This a wrapper of the same-named quad method.
105105

0 commit comments

Comments
 (0)