Skip to content

Commit c9f21c0

Browse files
authored
Merge pull request #221 from JorjMcKie/master
Publish v1.14.0
2 parents 2826da1 + f2fbee4 commit c9f21c0

28 files changed

+21740
-16607
lines changed

.travis.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ cache:
88
- "$HOME/Library/Caches/Homebrew"
99
env:
1010
global:
11-
- MUPDF='https://mupdf.com/downloads/mupdf-1.13.0-source.tar.gz'
11+
- MUPDF='https://mupdf.com/downloads/archive/mupdf-1.14.0-source.tar.gz'
1212
- COPYFILE_DISABLE=1
13-
- TWINE_USERNAME=rk700
1413
matrix:
1514
include:
1615
- os: linux
@@ -42,19 +41,17 @@ install:
4241
- mkdir mupdf && wget -q $MUPDF -O - | tar zx -C mupdf --strip-components=1
4342
- cp fitz/_mupdf_config.h mupdf/include/mupdf/fitz/config.h
4443
script:
45-
- export CIBW_ENVIRONMENT='CFLAGS="-fPIC -std=gnu99"'
4644
- export CIBW_SKIP="cp33-* *i686"
4745
- export CIBW_TEST_COMMAND="python -c 'import fitz'"
4846
- cibuildwheel --output-dir wheelhouse
4947

5048
deploy:
5149
provider: pages
52-
github_token:
53-
secure: aZCfaInTGLFs2Ik60w61g/wK7IR4sxK035H+YiKvIrwyufUVuafFlRlG9FLsxrhgYlh7KalNJciD9kdYCgQ3qt21lud9CviBgwNdFGF8LoUhzflr+MzOP51ESnHMgN3t51lN7Ui2RrFlsbST34O28tq8vyPitDS3AMXeuUSZzx8GpsFr/5wRvikd0q1QxF+KkeTp0iVRu4woV0LUNnDylEHRmHdvObuIXkQJunvsXW/Zpxzk8rREdW1/4mBqWV2H8ywk5nptgHfwcjmrpoPHrJOkgXYkXkONzXdC0OuL5SSHLFF4NPNNVdf6Rz4RoGsozI5rDvJ1lEEijz+1sEIQAvghprv9LgiSKs4ECnGtk6J65NCf1KT+3Sj7zcl9C7MmOdJFgnIeWGj5a34i+lGIph30ji3MiBwTnApMyaWHxF6+qshkmN5E+m4Y8XHVAS8gR3EEvLwPR15wmfRATHE2uc1y7p6yNeR95wS5xFqsrXjyZY0/9Ht29JQh/R1NZdLVNJD0/1hcaEhwMSTa1YGmDrUh+wGNjRlPgzS/y3nKG9vwFyPcO8sWaFVMBz1VyqT2ZYQq8Qg2Wtg3r0TvqntwN2ois9KRsr+j8yKGEXkTwZoi/6uL7sjl/NHUL5ps37s1h8GRMdhtQ4dz1s2x+E8kj5cZFGopFybAp44jmdz80wo=
50+
github_token: $GITHUB_TOKEN
5451
keep-history: false
5552
skip_cleanup: true
5653
local-dir: wheelhouse
5754
repo: JorjMcKie/PyMuPDF-wheels
5855
target-branch: $TRAVIS_OS_NAME
5956
on:
60-
repo: rk700/PyMuPDF
57+
repo: JorjMcKie/py-mupdf

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# PyMuPDF 1.13.20
1+
# PyMuPDF 1.14.0
22

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

5-
Release date: September 10, 2018
5+
Release date: November 15, 2018
66

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

99
On **[PyPI](https://pypi.org/project/PyMuPDF)** since August 2016: [![](https://pepy.tech/badge/pymupdf)](https://pepy.tech/project/pymupdf)
1010

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

1515
# Introduction
1616

17-
This is **version 1.13.20 of PyMuPDF (formerly python-fitz)**, a Python binding with support for [MuPDF 1.13.0](http://mupdf.com/) - "a lightweight PDF, XPS, and E-book viewer".
17+
This is **version 1.14.0 of PyMuPDF (formerly python-fitz)**, a Python binding with support for [MuPDF 1.14.0](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

@@ -32,14 +32,14 @@ The platform tag for Linux is `manylinux1_x86_64`, which makes these wheels usab
3232

3333
On other operating systems you need to generate PyMuPDF yourself. Before you can do this, you must download and generate MuPDF. This process depends very much on your system. For most platforms, the MuPDF source contains prepared procedures for achieving this.
3434

35-
Be sure to download the official MuPDF source release from [here](https://mupdf.com/downloads). Do **not use** MuPDF's [GitHub repo](https://github.com/ArtifexSoftware/mupdf). It contains their current **development source**, which is **not compatible** with the published PyMuPDF version most of the time.
35+
Be sure to download the official MuPDF source release from [here](https://mupdf.com/downloads). Do **not use** MuPDF's [GitHub repo](https://github.com/ArtifexSoftware/mupdf). It contains their current **development source**, which is **not compatible** with this PyMuPDF version most of the time.
3636

37-
Once this is done, adjust directories in ``setup.py`` and the rest should be as easy as running the usual ``python setup.py install``.
37+
Once this is done, adjust directories in ``setup.py`` and run ``python setup.py install``.
3838

39-
The following sections contain some platform-specific comments.
39+
The following sections contain further comments for some platforms.
4040

4141
## Ubuntu
42-
One of our users (thanks to **@gileadslostson**!) has documented his MuPDF installation experience from sources in this [Wiki page](https://github.com/rk700/PyMuPDF/wiki/Experience-from-an-Ubuntu-installation).
42+
Our users (thanks to **@gileadslostson** and **@jbarlow83**!) have documented their MuPDF installation experiences from sources in this [Wiki page](https://github.com/rk700/PyMuPDF/wiki/Experience-from-an-Ubuntu-installation).
4343

4444
## OSX
4545
First, install the MuPDF headers and libraries, which are provided by mupdf-tools: ``brew install mupdf-tools``.

doc/PyMuPDF.pdf

119 KB
Binary file not shown.

doc/html.zip

-5.82 MB
Binary file not shown.

examples/posterize.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
1111
Result
1212
-------
13-
A file "poster-input.pdf" with 4 output pages for every input page.
13+
The file "poster-input.pdf" with 4 output pages for every input page:
14+
top-lef, top-right, bottom-left, bottom-right part on separate pages.
1415
1516
Notes
1617
-----

fitz/__init__.py

Lines changed: 4 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,6 @@
11
from __future__ import absolute_import
22
from fitz.fitz import *
3-
4-
class M_Identity(fitz.Matrix):
5-
"""Identity matrix [1, 0, 0, 1, 0, 0]"""
6-
def __init__(self):
7-
fitz.Matrix.__init__(self, 1.0, 1.0)
8-
def __setattr__(self, name, value):
9-
if name in "abcdef":
10-
raise NotImplementedError("Identity is readonly")
11-
else:
12-
super(fitz.Matrix, self).__setattr__(name, value)
13-
14-
def checkargs(*args):
15-
raise NotImplementedError("Identity is readonly")
16-
preRotate = checkargs
17-
preShear = checkargs
18-
preScale = checkargs
19-
preTranslate = checkargs
20-
concat = checkargs
21-
invert = checkargs
22-
def __repr__(self):
23-
return "fitz.Identity"
24-
25-
Identity = M_Identity()
26-
27-
fitz.Identity = Identity
3+
from fitz import _fitz
284

295
# define the supported colorspaces for convenience
306
fitz.csRGB = fitz.Colorspace(fitz.CS_RGB)
@@ -34,6 +10,9 @@ def __repr__(self):
3410
csGRAY = fitz.csGRAY
3511
csCMYK = fitz.csCMYK
3612

13+
TOOLS = fitz.Tools()
14+
fitz.TOOLS = TOOLS
15+
3716
import fitz.utils
3817

3918
# copy functions to their respective fitz classes
@@ -83,89 +62,17 @@ def __repr__(self):
8362
#------------------------------------------------------------------------------
8463
fitz.Pixmap.writeImage = fitz.utils.writeImage
8564

86-
#------------------------------------------------------------------------------
87-
# Annot
88-
#------------------------------------------------------------------------------
89-
fitz.Annot.updateImage = fitz.utils.updateImage
90-
91-
#------------------------------------------------------------------------------
92-
# Matrix algebra
93-
#------------------------------------------------------------------------------
94-
fitz.Matrix.__abs__ = fitz.utils.mat_abs
95-
fitz.Matrix.__add__ = fitz.utils.mat_add
96-
fitz.Matrix.__bool__ = fitz.utils.mat_true
97-
fitz.Matrix.__contains__ = fitz.utils.mat_contains
98-
fitz.Matrix.__div__ = fitz.utils.mat_div
99-
fitz.Matrix.__eq__ = fitz.utils.mat_equ
100-
fitz.Matrix.__invert__ = fitz.utils.mat_invert
101-
fitz.Matrix.__mul__ = fitz.utils.mat_mult
102-
fitz.Matrix.__neg__ = lambda x: fitz.Matrix(x)*-1 # unary "-"
103-
fitz.Matrix.__nonzero__ = fitz.utils.mat_true
104-
fitz.Matrix.__pos__ = lambda x: fitz.Matrix(x) # unary "+"
105-
fitz.Matrix.__sub__ = fitz.utils.mat_sub
106-
fitz.Matrix.__truediv__ = fitz.utils.mat_div
107-
108-
10965
#------------------------------------------------------------------------------
11066
# Rect
11167
#------------------------------------------------------------------------------
11268
fitz.Rect.getRectArea = fitz.utils.getRectArea
11369
fitz.Rect.getArea = fitz.utils.getRectArea
114-
fitz.Rect.intersects = fitz.utils.intersects
115-
# Rect algebra
116-
fitz.Rect.__neg__ = lambda x: fitz.Rect(x)*-1 # unary "-"
117-
fitz.Rect.__pos__ = lambda x: fitz.Rect(x) # unary "+"
118-
fitz.Rect.__abs__ = lambda x: fitz.Rect.getArea(x) # abs
119-
fitz.Rect.__or__ = fitz.utils.rect_or
120-
fitz.Rect.__and__ = fitz.utils.rect_and
121-
fitz.Rect.__add__ = fitz.utils.rect_add
122-
fitz.Rect.__sub__ = fitz.utils.rect_sub
123-
fitz.Rect.__mul__ = fitz.utils.rect_mul
124-
fitz.Rect.__truediv__ = fitz.utils.rect_div
125-
fitz.Rect.__div__ = fitz.utils.rect_div
126-
fitz.Rect.__eq__ = fitz.utils.rect_equ
127-
fitz.Rect.__nonzero__ = fitz.utils.rect_true
128-
fitz.Rect.__bool__ = fitz.utils.rect_true
129-
fitz.Rect.__contains__ = fitz.utils.rect_contains
13070

13171
#------------------------------------------------------------------------------
13272
# IRect
13373
#------------------------------------------------------------------------------
13474
fitz.IRect.getRectArea = fitz.utils.getRectArea
13575
fitz.IRect.getArea = fitz.utils.getRectArea
136-
fitz.IRect.intersects = fitz.utils.intersects
137-
# IRect algebra
138-
fitz.IRect.__neg__ = lambda x: fitz.IRect(x)*-1 # unary "-"
139-
fitz.IRect.__pos__ = lambda x: fitz.IRect(x) # unary "+"
140-
fitz.IRect.__abs__ = lambda x: fitz.IRect.getArea(x) # abs
141-
fitz.IRect.__or__ = fitz.utils.rect_or
142-
fitz.IRect.__and__ = fitz.utils.rect_and
143-
fitz.IRect.__add__ = fitz.utils.rect_add
144-
fitz.IRect.__sub__ = fitz.utils.rect_sub
145-
fitz.IRect.__mul__ = fitz.utils.rect_mul
146-
fitz.IRect.__truediv__ = fitz.utils.rect_div
147-
fitz.IRect.__div__ = fitz.utils.rect_div
148-
fitz.IRect.__eq__ = fitz.utils.rect_equ
149-
fitz.IRect.__nonzero__ = fitz.utils.rect_true
150-
fitz.IRect.__bool__ = fitz.utils.rect_true
151-
fitz.IRect.__contains__ = fitz.utils.rect_contains
152-
153-
#------------------------------------------------------------------------------
154-
# Point algebra
155-
#------------------------------------------------------------------------------
156-
fitz.Point.__neg__ = lambda x: fitz.Point(x)*-1 # unary "-"
157-
fitz.Point.__pos__ = lambda x: fitz.Point(x) # unary "+"
158-
fitz.Point.__add__ = fitz.utils.point_add
159-
fitz.Point.__sub__ = fitz.utils.point_sub
160-
fitz.Point.__abs__ = fitz.utils.point_abs
161-
fitz.Point.__mul__ = fitz.utils.point_mul
162-
fitz.Point.__truediv__ = fitz.utils.point_div
163-
fitz.Point.__div__ = fitz.utils.point_div
164-
fitz.Point.__nonzero__ = fitz.utils.point_true
165-
fitz.Point.__bool__ = fitz.utils.point_true
166-
fitz.Point.__eq__ = fitz.utils.point_equ
167-
fitz.Point.__contains__ = fitz.utils.point_contains
168-
16976

17077
fitz.__doc__ = "PyMuPDF %s: Python bindings for the MuPDF %s library,\nbuilt on %s" \
17178
% (fitz.VersionBind, fitz.VersionFitz, fitz.VersionDate)

0 commit comments

Comments
 (0)