Skip to content

Commit 8af219a

Browse files
committed
upgrade to v1.16.13
1 parent c876582 commit 8af219a

16 files changed

+242
-131
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.12
3+
Version: 1.16.13
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: March 10, 2020
12+
Release date: March 15, 2020
1313

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

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

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

5-
Release date: March 10, 2020
5+
Release date: March 15, 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.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".
17+
This is **version 1.16.13 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/app4.rst

+3-1
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,13 @@ To see how these fonts can be used -- including the **CJK built-in** fonts -- lo
4949

5050
.. _AdobeManual:
5151

52-
Adobe PDF Reference 1.7
52+
Adobe PDF References
5353
---------------------------
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.
58+
5759
------------
5860

5961
.. _SequenceTypes:

docs/changes.rst

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

4+
Changes in Version 1.16.13
5+
---------------------------
6+
7+
* **Added** :meth:`Document.getPageXObjectList` which returns a list of **Form XObjects** of the page.
8+
* **Added** :meth:`Page.setMediaBox` for changing the physical PDF page size.
9+
* **Added** :ref:`Page` methods which have been internal before: :meth:`Page.cleanContents` (= :meth:`Page._cleanContents`), :meth:`Page.getContents` (= :meth:`Page._getContents`), :meth:`Page.getTransformation` (= :meth:`Page._getTransformation`).
10+
11+
12+
413
Changes in Version 1.16.12
514
---------------------------
615
* **Fixed** issue `#447 <https://github.com/pymupdf/PyMuPDF/issues/447>`_

docs/conf.py

+2-2
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.16.12"
49+
release = "1.16.13"
5050

5151
# The short X.Y version
5252
version = release
@@ -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

+37-23
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ For addional details on **embedded files** refer to Appendix 3.
3232
:meth:`Document.fullcopyPage` PDF only: duplicate a page
3333
:meth:`Document.getPageFontList` PDF only: make a list of fonts on a page
3434
:meth:`Document.getPageImageList` PDF only: make a list of images on a page
35+
:meth:`Document.getPageXObjectList` PDF only: make a list of XObjects on a page
3536
:meth:`Document.getPagePixmap` create a pixmap of a page by page number
3637
:meth:`Document.getPageText` extract the text of a page by page number
3738
:meth:`Document.getSigFlags` PDF only: determine signature state
@@ -260,30 +261,45 @@ For addional details on **embedded files** refer to Appendix 3.
260261

261262
:rtype: :ref:`Pixmap`
262263

264+
.. method:: getPageXObjectList(pno)
265+
266+
PDF only: *(New in v1.16.13)* Return a list of all XObjects referenced by a page.
267+
268+
:arg int pno: page number, 0-based, *-inf < pno < pageCount*.
269+
270+
:rtype: list
271+
:returns: a list of (non-image) XObjects. These objects typically represent pages *embedded* (not copied) from other PDFs. For example, meth:`Page.showPDFpage` will create this type of object. An item of this list has the following layout: **(xref, name, invoker, bbox)**, where
272+
273+
* **xref** (*int*) is the XObject's :data:`xref`
274+
* **name** (*str*) is the symbolic name to reference the XObject
275+
* **invoker** (*int*) the :data:`xref` of the invoking XObject or zero if the page directly invokes it
276+
* **bbox** (*tuple*) the boundary box of the XObject's location on the page **in untransformed coordinates**. To get actual, non-rotated page coordinates, multiply with the page's transformation matrix :meth:`Page.getTransformation`.
277+
278+
263279
.. method:: getPageImageList(pno, full=False)
264280

265281
PDF only: Return a list of all image descriptions referenced by a page.
266282

267-
:arg int pno: page number, 0-based in -inf < pno < pageCount.
268-
:arg bool full: whether to also include the :data:`xref` of the *Form /XObject* where the item is referenced. This is zero if the item is part of page's /Resources.
283+
:arg int pno: page number, 0-based, *-inf < pno < pageCount*.
284+
:arg bool full: whether to also include the invoker's :data:`xref` (which is zero if this is the page).
269285

270286
:rtype: list
271287

272288
:returns: a list of images shown on this page. Each item looks like
273289

274-
**[xref, smask, width, height, bpc, colorspace, alt. colorspace, name, filter, form_xref],**
290+
**(xref, smask, width, height, bpc, colorspace, alt. colorspace, name, filter, invoker)**
275291

276292
Where
277293

278-
* **xref** (*int*) is the image object number,
279-
* **smask** (*int* optional) is the object number of its soft-mask image (if present),
280-
* **width** and **height** (*ints*) are the image dimensions,
281-
* **bpc** (*int*) denotes the number of bits per component (a typical value is 8),
282-
* **colorspace** (*str*)a string naming the colorspace (like **DeviceRGB**),
283-
* **alt. colorspace** (*str* optional) is any alternate colorspace depending on the value of **colorspace**,
284-
* **name** (*str*) is the symbolic name by which the **page references the image** in its content stream, and
285-
* **filter** (*str* optional) is the decode filter of the image (:ref:`AdobeManual`, pp. 65).
286-
* **form_xref** (*int* optional) the xref number of the *Form XObject*, which references the item. Zero if directly referenced by the page.
294+
* **xref** (*int*) is the image object number
295+
* **smask** (*int*) is the object number of its soft-mask image
296+
* **width** and **height** (*ints*) are the image dimensions
297+
* **bpc** (*int*) denotes the number of bits per component (normally 8)
298+
* **colorspace** (*str*) a string naming the colorspace (like **DeviceRGB**)
299+
* **alt. colorspace** (*str*) is any alternate colorspace depending on the value of **colorspace**
300+
* **name** (*str*) is the symbolic name by which the image is referenced
301+
* **filter** (*str*) is the decode filter of the image (:ref:`AdobeManual`, pp. 65).
302+
* **invoker** (*int*) the :data:`xref` of the invoker. Zero if directly referenced by the page. Only present if *full=True*.
287303

288304
See below how this information can be used to extract PDF images as separate files. Another demonstration::
289305

@@ -294,30 +310,28 @@ For addional details on **embedded files** refer to Appendix 3.
294310
>>> pix
295311
fitz.Pixmap(DeviceRGB, fitz.IRect(0, 0, 261, 115), 0)
296312

297-
.. note:: This list has no duplicate entries: the combination of :data:`xref` and *name* is unique. But by themselves, each of the two may occur multiple times. The same image may well be referenced under different names within a page. Duplicate *name* entries on the other hand indicate the presence of "Form XObjects" on the page, e.g. generated by :meth:`Page.showPDFpage`.
298-
299313
.. method:: getPageFontList(pno, full=False)
300314

301315
PDF only: Return a list of all fonts referenced by the page.
302316

303317
:arg int pno: page number, 0-based, -inf < pno < pageCount.
304-
:arg bool full: whether to also include the :data:`xref` of the *Form /XObject* where the item is referenced. This is zero if the item is part of page's /Resources.
318+
:arg bool full: whether to also include the invoker's :data:`xref` (which is zero if directly referenced by the page).
305319

306320
:rtype: list
307321

308322
:returns: a list of fonts referenced by this page. Each entry looks like
309323

310-
**[xref, ext, type, basefont, name, encoding, form_xref]**,
324+
**(xref, ext, type, basefont, name, encoding, invoker)**,
311325

312-
Where
326+
where
313327

314-
* **xref** (*int*) is the font object number (may be zero if the PDF uses one of the builtin fonts directly),
315-
* **ext** (*str*) font file extension (e.g. "ttf", see :ref:`FontExtensions`),
316-
* **type** (*str*) is the font type (like "Type1" or "TrueType" etc.),
328+
* **xref** (*int*) is the font object number (may be zero if the PDF uses one of the builtin fonts directly)
329+
* **ext** (*str*) font file extension (e.g. "ttf", see :ref:`FontExtensions`)
330+
* **type** (*str*) is the font type (like "Type1" or "TrueType" etc.)
317331
* **basefont** (*str*) is the base font name,
318-
* **name** (*str*) is the reference name (or label), by which **the page references the font** in its contents stream, and
319-
* **encoding** (*str* optional) the font's character encoding if different from its built-in encoding (:ref:`AdobeManual`, p. 414):
320-
* **form_xref** (*int* optional) the xref number of the *Form XObject*, which references the item. Zero if directly referenced by the page.
332+
* **name** (*str*) is the symbolic name, by which the font is referenced
333+
* **encoding** (*str*) the font's character encoding if different from its built-in encoding (:ref:`AdobeManual`, p. 414):
334+
* **invoker** (*int* optional) the :data:`xref` of the invoker. Zero if directly referenced by the page. Only present if *full=True*.
321335

322336
Example::
323337

docs/glossary.rst

+15-2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,19 @@ Glossary
2222

2323
A Python sequence of 4 :data:`point_like` items.
2424

25+
.. data:: inheritable
26+
27+
A number of values in a PDF can be specified once and then be inherited by objects further down in a parent-child relationship. The mediabox (physical size) of pages can for example be specified in nodes of the :data:`pagetree` and will then be taken as value for all *kids*, which do not specify their own value.
28+
29+
.. data:: MediaBox
30+
31+
A PDF array of 4 floats specifying a physical page size (:data:`inheritable`).
32+
33+
.. data:: CropBox
34+
35+
A PDF array of 4 floats specifying a page's visible area (:data:`inheritable`). This value is **not affected** if the page is rotated.
36+
37+
2538
.. data:: catalog
2639

2740
A central PDF :data:`dictionary` -- also called "root" -- containing pointers to many other information.
@@ -57,9 +70,9 @@ Glossary
5770
/Annots[55 0 R] % value: array, one entry (indirect object)
5871
>>
5972

60-
*/Contents*, */Type*, */MediaBox*, etc. are **keys**, *40 0 R*, */Page*, *[0 0 595.32 841.92]*, etc. are the respective **values**. The strings *<<* and *>>* are used to enclose object definitions.
73+
*Contents*, *Type*, *MediaBox*, etc. are **keys**, *40 0 R*, *Page*, *[0 0 595.32 841.92]*, etc. are the respective **values**. The strings *"<<"* and *">>"* are used to enclose object definitions.
6174

62-
This example also shows the syntax of **nested** dictionary values: */Resources* has an object as its value, which in turn is a dictionary with keys like */ExtGState* (with the value *<</R7 26 0 R>>*, which is another dictionary), etc.
75+
This example also shows the syntax of **nested** dictionary values: *Resources* has an object as its value, which in turn is a dictionary with keys like *ExtGState* (with the value *<</R7 26 0 R>>*, which is another dictionary), etc.
6376

6477
.. data:: page
6578

0 commit comments

Comments
 (0)