Skip to content

Commit 5eaeddc

Browse files
committed
update v1.16.12
1 parent f6e75e7 commit 5eaeddc

23 files changed

+938
-189
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.16.11
3+
Version: 1.16.12
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: February 23, 2020
12+
Release date: March 05, 2020
1313

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

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# PyMuPDF 1.16.11
1+
# PyMuPDF 1.16.12
22

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

5-
Release date: February 23, 2020
5+
Release date: March 10, 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.16.11 of PyMuPDF (formerly python-fitz)**, a Python binding with support for [MuPDF 1.16.*](http://mupdf.com/) - "a lightweight PDF, XPS, and E-book viewer".
17+
This is **version 1.16.12 of PyMuPDF (formerly python-fitz)**, a Python binding with support for [MuPDF 1.16.*](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

docs/annot.rst

+35-29
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,36 @@ Quote from the :ref:`AdobeManual`: "An annotation associates an object such as a
1111
There is a parent-child relationship between an annotation and its page. If the page object becomes unusable (closed document, any document structure change, etc.), then so does every of its existing annotation objects -- an exception is raised saying that the object is "orphaned", whenever an annotation property or method is accessed.
1212

1313

14-
============================ ==============================================================
15-
**Attribute** **Short Description**
16-
============================ ==============================================================
17-
:meth:`Annot.fileGet` return attached file content
18-
:meth:`Annot.fileInfo` return attached file information
19-
:meth:`Annot.fileUpd` set attached file new content
20-
:meth:`Annot.getPixmap` image of the annotation as a pixmap
21-
:meth:`Annot.setBorder` change the border
22-
:meth:`Annot.setColors` change the colors
23-
:meth:`Annot.setFlags` change the flags
24-
:meth:`Annot.setInfo` change various properties
25-
:meth:`Annot.setLineEnds` set line ending styles
26-
:meth:`Annot.setOpacity` change transparency
27-
:meth:`Annot.setName` change the "Name" field (e.g. icon name)
28-
:meth:`Annot.setRect` change the rectangle
29-
:meth:`Annot.update` apply accumulated annot changes
30-
:attr:`Annot.border` border details
31-
:attr:`Annot.colors` border / background and fill colors
32-
:attr:`Annot.flags` annotation flags
33-
:attr:`Annot.info` various information
34-
:attr:`Annot.lineEnds` start / end appearance of line-type annotations
35-
:attr:`Annot.next` link to the next annotation
36-
:attr:`Annot.opacity` the annot's transparency
37-
:attr:`Annot.parent` page object of the annotation
38-
:attr:`Annot.rect` rectangle containing the annotation
39-
:attr:`Annot.type` type of the annotation
40-
:attr:`Annot.vertices` point coordinates of Polygons, PolyLines, etc.
41-
:attr:`Annot.xref` the PDF :data:`xref` number
42-
============================ ==============================================================
14+
=============================== ==============================================================
15+
**Attribute** **Short Description**
16+
=============================== ==============================================================
17+
:meth:`Annot.delete_responses` delete all responding annotions
18+
:meth:`Annot.fileGet` return attached file content
19+
:meth:`Annot.fileInfo` return attached file information
20+
:meth:`Annot.fileUpd` set attached file new content
21+
:meth:`Annot.getPixmap` image of the annotation as a pixmap
22+
:meth:`Annot.setBorder` change the border
23+
:meth:`Annot.setColors` change the colors
24+
:meth:`Annot.setFlags` change the flags
25+
:meth:`Annot.setInfo` change various properties
26+
:meth:`Annot.setLineEnds` set line ending styles
27+
:meth:`Annot.setOpacity` change transparency
28+
:meth:`Annot.setName` change the "Name" field (e.g. icon name)
29+
:meth:`Annot.setRect` change the rectangle
30+
:meth:`Annot.update` apply accumulated annot changes
31+
:attr:`Annot.border` border details
32+
:attr:`Annot.colors` border / background and fill colors
33+
:attr:`Annot.flags` annotation flags
34+
:attr:`Annot.info` various information
35+
:attr:`Annot.lineEnds` start / end appearance of line-type annotations
36+
:attr:`Annot.next` link to the next annotation
37+
:attr:`Annot.opacity` the annot's transparency
38+
:attr:`Annot.parent` page object of the annotation
39+
:attr:`Annot.rect` rectangle containing the annotation
40+
:attr:`Annot.type` type of the annotation
41+
:attr:`Annot.vertices` point coordinates of Polygons, PolyLines, etc.
42+
:attr:`Annot.xref` the PDF :data:`xref` number
43+
=============================== ==============================================================
4344

4445
**Class API**
4546

@@ -137,6 +138,11 @@ There is a parent-child relationship between an annotation and its page. If the
137138
:arg sequence fill: see above.
138139

139140

141+
.. method:: delete_responses()
142+
143+
*(New in version 1.16.12)* Delete annotations referring to this one. This includes any 'Popup' annotations and all annotations responding to it.
144+
145+
140146
.. index::
141147
pair: fontsize; update
142148
pair: text_color; update

docs/changes.rst

+10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
Change Logs
22
===============
33

4+
Changes in Version 1.16.12
5+
---------------------------
6+
* **Fixed** issue `#447 <https://github.com/pymupdf/PyMuPDF/issues/447>`_
7+
* **Fixed** issue `#461 <https://github.com/pymupdf/PyMuPDF/issues/461>`_.
8+
* **Fixed** issue `#397 <https://github.com/pymupdf/PyMuPDF/issues/397>`_.
9+
* **Added** JavaScript support to PDF form fields, thereby addressing `#454 <https://github.com/pymupdf/PyMuPDF/issues/454>`_.
10+
* **Added** a new annotation method :meth:`Annot.delete_responses`, which removes 'Popup' and response annotations referring to the current one.
11+
* **Added** a new form field method :meth:`Widget.reset`, which resets the field value to its default.
12+
* **Changed** and extended handling of redactions: images and XObjects are removed if *contained* in a redaction rectangle. Any partial overlaps will just be covered by the redaction background color. Now a text can be specified to be inserted in the rectangle area to **replace the deleted original** text. This resolves `#434 <https://github.com/pymupdf/PyMuPDF/issues/434>`_.
13+
414
Changes in Version 1.16.11
515
---------------------------
616
* **Added** Support for redaction annotations via method :meth:`Page.addRedactAnnot` and :meth:`Page.apply_redactions`.

docs/colors.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ As the color database may not be needed very often, one additional import statem
3737

3838
Printing the Color Database
3939
----------------------------
40-
If you want to actually see how the many available colors look like, use scripts `colordbRGB.py <https://github.com/pymupdf/PyMuPDF/blob/master/examples/colordbRGB.py>`_ or `colordbHSV.py <https://github.com/pymupdf/PyMuPDF/blob/master/examples/colordbHSV.py>`_ in the examples directory. They create PDFs (already existing in the same directory) with all these colors. Their only difference is sorting order: one takes the RGB values, the other one the Hue-Saturation-Values as sort criteria.
40+
If you want to actually see how the many available colors look like, use scripts `colordbRGB.py <https://github.com/pymupdf/PyMuPDF-Utilities/tree/master/examples/colordbRGB.py>`_ or `colordbHSV.py <https://github.com/pymupdf/PyMuPDF-Utilities/tree/master/examples/colordbHSV.py>`_ in the examples directory. They create PDFs (already existing in the same directory) with all these colors. Their only difference is sorting order: one takes the RGB values, the other one the Hue-Saturation-Values as sort criteria.
4141
This is a screen print of what these files look like.
4242

4343
.. image:: images/img-colordb.png

docs/conf.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@
3939

4040
# General information about the project.
4141
project = "PyMuPDF"
42-
copyright = "2015-2019, Jorj X. McKie"
42+
copyright = "2015-2020, Jorj X. McKie"
4343

4444
# The version info for the project you're documenting, acts as replacement for
4545
# |version| and |release|, also used in various other places throughout the
4646
# built documents.
4747
#
4848
# The full version, including alpha/beta/rc tags.
49-
release = "1.16.11"
49+
release = "1.16.12"
5050

5151
# The short X.Y version
5252
version = release
@@ -95,10 +95,10 @@
9595
# The theme to use for HTML and HTML Help pages. See the documentation for
9696
# a list of builtin themes.
9797
# html_theme = "agogo"
98-
# html_theme = "sphinxdoc"
98+
html_theme = "sphinxdoc"
9999
# html_theme = "python_docs_theme"
100100
# html_theme = "sphinx_rtd_theme"
101-
html_theme = "classic"
101+
# html_theme = "classic"
102102

103103
# Theme options are theme-specific and customize the look and feel of a theme
104104
# further. For a list of options available for each theme, see the
@@ -128,7 +128,7 @@
128128
# The name of an image file (within the static path) to use as favicon of the
129129
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
130130
# pixels large.
131-
html_favicon = "PyMuPDF.ico"
131+
html_favicon = "pymupdf.ico"
132132

133133
# Add any paths that contain custom static files (such as style sheets) here,
134134
# relative to this directory. They are copied after the builtin static files,

docs/document.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ For addional details on **embedded files** refer to Appendix 3.
500500

501501
1. If *from_page > to_page*, pages will be **copied in reverse order**. If *0 <= from_page == to_page*, then one page will be copied.
502502

503-
2. *docsrc* bookmarks **will not be copied**. It is easy however, to recover a table of contents for the resulting document. Look at the examples below and at program `PDFjoiner.py <https://github.com/pymupdf/PyMuPDF/blob/master/examples/PDFjoiner.py>`_ in the *examples* directory: it can join PDF documents and at the same time piece together respective parts of the tables of contents.
503+
2. *docsrc* bookmarks **will not be copied**. It is easy however, to recover a table of contents for the resulting document. Look at the examples below and at program `PDFjoiner.py <https://github.com/pymupdf/PyMuPDF-Utilities/tree/master/examples/PDFjoiner.py>`_ in the *examples* directory: it can join PDF documents and at the same time piece together respective parts of the tables of contents.
504504

505505
.. index::
506506
pair: width; newPage (Document method)
@@ -894,7 +894,7 @@ Clear metadata information. If you do this out of privacy / data protection conc
894894

895895
:meth:`setToC` Demonstration
896896
----------------------------------
897-
This shows how to modify or add a table of contents. Also have a look at `csv2toc.py <https://github.com/pymupdf/PyMuPDF/blob/master/examples/csv2toc.py>`_ and `toc2csv.py <https://github.com/pymupdf/PyMuPDF/blob/master/examples/toc2csv.py>`_ in the examples directory.
897+
This shows how to modify or add a table of contents. Also have a look at `csv2toc.py <https://github.com/pymupdf/PyMuPDF-Utilities/tree/master/examples/csv2toc.py>`_ and `toc2csv.py <https://github.com/pymupdf/PyMuPDF-Utilities/tree/master/examples/toc2csv.py>`_ in the examples directory.
898898

899899
>>> import fitz
900900
>>> doc = fitz.open("test.pdf")
@@ -927,7 +927,7 @@ This shows how to modify or add a table of contents. Also have a look at `csv2to
927927
t[2] += pages1 # by old len(doc1)
928928
>>> doc1.setToC(toc1 + toc2) # now result has total TOC
929929

930-
Obviously, similar ways can be found in more general situations. Just make sure that hierarchy levels in a row do not increase by more than one. Inserting dummy bookmarks before and after *toc2* segments would heal such cases. A ready-to-use GUI (wxPython) solution can be found in script `PDFjoiner.py <https://github.com/pymupdf/PyMuPDF/blob/master/examples/PDFjoiner.py>`_ of the examples directory.
930+
Obviously, similar ways can be found in more general situations. Just make sure that hierarchy levels in a row do not increase by more than one. Inserting dummy bookmarks before and after *toc2* segments would heal such cases. A ready-to-use GUI (wxPython) solution can be found in script `PDFjoiner.py <https://github.com/pymupdf/PyMuPDF-Utilities/tree/master/examples/PDFjoiner.py>`_ of the examples directory.
931931

932932
**(2) More examples:**
933933

@@ -965,4 +965,4 @@ Other Examples
965965

966966
.. [#f1] Content streams describe what (e.g. text or images) appears where and how on a page. PDF uses a specialized mini language similar to PostScript to do this (pp. 985 in :ref:`AdobeManual`), which gets interpreted when a page is loaded.
967967
968-
.. [#f2] However, you **can** use :meth:`Document.getToC` and :meth:`Page.getLinks` (which are available for all document types) and copy this information over to the output PDF. See demo `pdf-converter.py <https://github.com/pymupdf/PyMuPDF/blob/master/demo/pdf-converter.py>`_.
968+
.. [#f2] However, you **can** use :meth:`Document.getToC` and :meth:`Page.getLinks` (which are available for all document types) and copy this information over to the output PDF. See demo `pdf-converter.py <https://github.com/pymupdf/PyMuPDF-Utilities/tree/master/demo/pdf-converter.py>`_.

docs/faq.rst

+15-4
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ If you see a table in a document, you are not normally looking at something like
763763

764764
Extracting a tabular data from such a page area therefore means that you must find a way to **(1)** graphically indicate table and column borders, and **(2)** then extract text based on this information.
765765

766-
The wxPython GUI script `wxTableExtract.py <https://github.com/pymupdf/PyMuPDF/blob/master/examples/wxTableExtract.py>`_ strives to exactly do that. You may want to have a look at it and adjust it to your liking.
766+
The wxPython GUI script `wxTableExtract.py <https://github.com/pymupdf/PyMuPDF-Utilities/tree/master/examples/wxTableExtract.py>`_ strives to exactly do that. You may want to have a look at it and adjust it to your liking.
767767

768768
----------
769769

@@ -1096,7 +1096,7 @@ The result looks like this:
10961096

10971097
How to Use FreeText
10981098
~~~~~~~~~~~~~~~~~~~~~
1099-
This script shows a couple of possibilities for 'FreeText' annotations::
1099+
This script shows a couple of ways to deal with 'FreeText' annotations::
11001100

11011101
# -*- coding: utf-8 -*-
11021102
import fitz
@@ -1134,6 +1134,17 @@ The result looks like this:
11341134
.. image:: images/img-freetext.jpg
11351135
:scale: 80
11361136

1137+
------------------------------
1138+
1139+
Using Buttons and JavaScript
1140+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1141+
Since MuPDF v1.16, 'FreeText' annotations no longer support bold or italic versions of the Times-Roman, Helvetica or Courier fonts.
1142+
1143+
A big **thank you** to our user `@kurokawaikki <https://github.com/kurokawaikki>`_, who contributed the following script to **circumvent this restriction**.
1144+
1145+
.. literalinclude:: make-bold.py
1146+
:language: python
1147+
11371148
--------------------------
11381149

11391150
How to Use Ink Annotations
@@ -1319,7 +1330,7 @@ PDF supports incorporating arbitrary data. This can be done in one of two ways:
13191330

13201331
The basic differences between these options are **(1)** you need edit permission to embed a file, but only annotation permission to attach, **(2)** like all annotations, attachments are visible on a page, embedded files are not.
13211332

1322-
There exist several example scripts: `embedded-list.py <https://github.com/pymupdf/PyMuPDF/blob/master/examples/embedded-list.py>`_, `new-annots.py <https://github.com/pymupdf/PyMuPDF/blob/master/demo/new-annots.py>`_.
1333+
There exist several example scripts: `embedded-list.py <https://github.com/pymupdf/PyMuPDF-Utilities/tree/master/examples/embedded-list.py>`_, `new-annots.py <https://github.com/pymupdf/PyMuPDF-Utilities/tree/master/demo/new-annots.py>`_.
13231334

13241335
Also look at the sections above and at chapter :ref:`Appendix 3`.
13251336

@@ -1374,7 +1385,7 @@ How to Join PDFs
13741385
~~~~~~~~~~~~~~~~~~
13751386
It is easy to join PDFs with method :meth:`Document.insertPDF`. Given open PDF documents, you can copy page ranges from one to the other. You can select the point where the copied pages should be placed, you can revert the page sequence and also change page rotation. This Wiki `article <https://github.com/pymupdf/PyMuPDF/wiki/Inserting-Pages-from-other-PDFs>`_ contains a full description.
13761387

1377-
The GUI script `PDFjoiner.py <https://github.com/pymupdf/PyMuPDF/blob/master/examples/PDFjoiner.py>`_ uses this method to join a list of files while also joining the respective table of contents segments. It looks like this:
1388+
The GUI script `PDFjoiner.py <https://github.com/pymupdf/PyMuPDF-Utilities/tree/master/examples/PDFjoiner.py>`_ uses this method to join a list of files while also joining the respective table of contents segments. It looks like this:
13781389

13791390
.. image:: images/img-pdfjoiner.jpg
13801391
:scale: 60

0 commit comments

Comments
 (0)