You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary: PyMuPDF is a Python binding for the PDF rendering library MuPDF
11
11
Description:
12
-
Release date: May 18, 2020
12
+
Release date: June 20, 2020
13
13
14
14
Authors
15
15
=======
@@ -20,7 +20,7 @@ Description:
20
20
Introduction
21
21
============
22
22
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".
24
24
25
25
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.
@@ -14,7 +14,7 @@ On **[PyPI](https://pypi.org/project/PyMuPDF)** since August 2016: [**, 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".
18
18
19
19
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.
20
20
@@ -52,7 +52,7 @@ Have a look at the basic [demos](https://github.com/pymupdf/PyMuPDF-Utilities/tr
52
52
53
53
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.
54
54
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.
56
56
* Find a Windows help file [here](https://github.com/pymupdf/PyMuPDF-optional-material/tree/master/doc/PyMuPDF.chm).
: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
140
141
141
142
: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.
142
143
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.
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
191
207
* :meth:`setRect`
192
208
* :meth:`setFlags`
193
209
* :meth:`fileUpd`
194
-
* :meth:`setInfo` (except changes to *"content"*)
210
+
* :meth:`setInfo` (except any changes to *"content"*)
195
211
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.
197
213
198
214
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.
199
215
@@ -205,9 +221,9 @@ There is a parent-child relationship between an annotation and its page. If the
205
221
:arg sequence,float fill_color: the fill color.
206
222
207
223
* '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)*.
209
225
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.
211
227
212
228
:rtype: bool
213
229
@@ -258,6 +274,13 @@ There is a parent-child relationship between an annotation and its page. If the
258
274
259
275
:rtype::ref:`Page`
260
276
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
+
261
284
.. attribute:: rect
262
285
263
286
The rectangle containing the annotation.
@@ -387,3 +410,7 @@ This is how the circle annotation looks like before and after the change (pop-up
387
410
388
411
.. |circle| image:: images/img-circle.png
389
412
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.
Copy file name to clipboardExpand all lines: docs/app4.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -54,7 +54,7 @@ Adobe PDF References
54
54
55
55
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>`_.
56
56
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.
* **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
+
4
12
Changes in Version 1.17.0
5
13
---------------------------
6
14
This version is based on MuPDF v1.17. Following are highlights of new and changed features:
Copy file name to clipboardExpand all lines: docs/functions.rst
+8-4Lines changed: 8 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,18 +1,21 @@
1
1
============
2
2
Functions
3
3
============
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.
5
5
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.
0 commit comments