Skip to content

Commit b84e1de

Browse files
committed
Upload version 1.14.15
1 parent 15abeca commit b84e1de

File tree

9 files changed

+61
-44
lines changed

9 files changed

+61
-44
lines changed

PKG-INFO

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Metadata-Version: 1.1
22
Name: PyMuPDF
3-
Version: 1.14.15
3+
Version: 1.15.0
44
Author: Ruikai Liu
55
Author-email: [email protected]
66
Maintainer: Jorj X. McKie
@@ -21,7 +21,7 @@ Description:
2121
Introduction
2222
============
2323

24-
This is **version 1.14.15 of PyMuPDF**, a Python binding for `MuPDF <http://mupdf.com/>`_ - "a lightweight PDF and XPS viewer".
24+
This is **version 1.15.0 of PyMuPDF**, a Python binding for `MuPDF <http://mupdf.com/>`_ - "a lightweight PDF and XPS viewer".
2525

2626
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.
2727

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# PyMuPDF 1.14.15
1+
# PyMuPDF 1.15.0
22

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

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

1515
# Introduction
1616

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

doc/PyMuPDF.pdf

9.06 KB
Binary file not shown.

doc/html.zip

12.4 KB
Binary file not shown.

fitz/fitz.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ class _object:
112112

113113
VersionFitz = "1.14.0"
114114
VersionBind = "1.14.15"
115-
VersionDate = "2019-04-29 07:25:13"
116-
version = (VersionBind, VersionFitz, "20190429072513")
115+
VersionDate = "2019-05-22 14:26:15"
116+
version = (VersionBind, VersionFitz, "20190522142615")
117117

118118

119119
class Matrix():

fitz/utils.py

Lines changed: 51 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,132 +1158,132 @@ def insertPage(
11581158
)
11591159
return rc
11601160

1161-
def drawLine(page, p1, p2, color=None, dashes=None, width=1, roundCap=False, overlay=True, morph=None):
1161+
def drawLine(page, p1, p2, color=None, dashes=None, width=1, lineCap=0, lineJoin=0, overlay=True, morph=None, roundcap=None):
11621162
"""Draw a line from point p1 to point p2.
11631163
"""
11641164
img = page.newShape()
11651165
p = img.drawLine(Point(p1), Point(p2))
11661166
img.finish(color=color, dashes=dashes, width=width, closePath=False,
1167-
roundCap=roundCap, morph=morph)
1167+
lineCap=lineCap, lineJoin=lineJoin, morph=morph, roundCap=roundcap)
11681168
img.commit(overlay)
11691169

11701170
return p
11711171

11721172
def drawSquiggle(page, p1, p2, breadth = 2, color=None, dashes=None,
1173-
width=1, roundCap=False, overlay=True, morph=None):
1173+
width=1, lineCap=0, lineJoin=0, overlay=True, morph=None, roundCap=None):
11741174
"""Draw a squiggly line from point p1 to point p2.
11751175
"""
11761176
img = page.newShape()
11771177
p = img.drawSquiggle(Point(p1), Point(p2), breadth = breadth)
11781178
img.finish(color=color, dashes=dashes, width=width, closePath=False,
1179-
roundCap=roundCap, morph=morph)
1179+
lineCap=lineCap, lineJoin=lineJoin, morph=morph, roundCap=roundCap)
11801180
img.commit(overlay)
11811181

11821182
return p
11831183

11841184
def drawZigzag(page, p1, p2, breadth = 2, color=None, dashes=None,
1185-
width=1, roundCap=False, overlay=True, morph=None):
1185+
width=1, lineCap=0, lineJoin=0, overlay=True, morph=None, roundCap=None):
11861186
"""Draw a zigzag line from point p1 to point p2.
11871187
"""
11881188
img = page.newShape()
11891189
p = img.drawZigzag(Point(p1), Point(p2), breadth = breadth)
11901190
img.finish(color=color, dashes=dashes, width=width, closePath=False,
1191-
roundCap=roundCap, morph=morph)
1191+
lineCap=lineCap, lineJoin=lineJoin, morph=morph, roundCap=roundCap)
11921192
img.commit(overlay)
11931193

11941194
return p
11951195

11961196
def drawRect(page, rect, color=None, fill=None, dashes=None,
1197-
width=1, roundCap=False, morph=None, overlay=True):
1197+
width=1, lineCap=0, lineJoin=0, morph=None, roundCap=None, overlay=True):
11981198
"""Draw a rectangle.
11991199
"""
12001200
img = page.newShape()
12011201
Q = img.drawRect(Rect(rect))
12021202
img.finish(color=color, fill=fill, dashes=dashes, width=width,
1203-
roundCap=roundCap, morph=morph)
1203+
lineCap=lineCap, lineJoin=lineJoin, morph=morph, roundCap=roundCap)
12041204
img.commit(overlay)
12051205

12061206
return Q
12071207

12081208
def drawQuad(page, quad, color=None, fill=None, dashes=None,
1209-
width=1, roundCap=False, morph=None, overlay=True):
1209+
width=1, lineCap=0, lineJoin=0, morph=None, roundCap=None, overlay=True):
12101210
"""Draw a quadrilateral.
12111211
"""
12121212
img = page.newShape()
12131213
Q = img.drawQuad(Quad(quad))
12141214
img.finish(color=color, fill=fill, dashes=dashes, width=width,
1215-
roundCap=roundCap, morph=morph)
1215+
lineCap=lineCap, lineJoin=lineJoin, morph=morph, roundCap=roundCap)
12161216
img.commit(overlay)
12171217

12181218
return Q
12191219

12201220
def drawPolyline(page, points, color=None, fill=None, dashes=None,
1221-
width=1, morph=None, roundCap=False, overlay=True,
1221+
width=1, morph=None, lineCap=0, lineJoin=0, roundCap=None, overlay=True,
12221222
closePath=False):
12231223
"""Draw multiple connected line segments.
12241224
"""
12251225
img = page.newShape()
12261226
Q = img.drawPolyline(points)
12271227
img.finish(color=color, fill=fill, dashes=dashes, width=width,
1228-
roundCap=roundCap, morph=morph, closePath=closePath)
1228+
lineCap=lineCap, lineJoin=lineJoin, morph=morph, roundCap=roundCap, closePath=closePath)
12291229
img.commit(overlay)
12301230

12311231
return Q
12321232

12331233
def drawCircle(page, center, radius, color=None, fill=None,
12341234
morph=None, dashes=None, width=1,
1235-
roundCap=False, overlay=True):
1235+
lineCap=0, lineJoin=0, roundCap=None, overlay=True):
12361236
"""Draw a circle given its center and radius.
12371237
"""
12381238
img = page.newShape()
12391239
Q = img.drawCircle(Point(center), radius)
12401240
img.finish(color=color, fill=fill, dashes=dashes, width=width,
1241-
roundCap=roundCap, morph=morph)
1241+
lineCap=lineCap, lineJoin=lineJoin, morph=morph, roundCap=roundCap)
12421242
img.commit(overlay)
12431243
return Q
12441244

12451245
def drawOval(page, rect, color=None, fill=None, dashes=None,
1246-
morph=None,
1247-
width=1, roundCap=False, overlay=True):
1246+
morph=None,roundCap=None,
1247+
width=1, lineCap=0, lineJoin=0, overlay=True):
12481248
"""Draw an oval given its containing rectangle or quad.
12491249
"""
12501250
img = page.newShape()
12511251
Q = img.drawOval(rect)
12521252
img.finish(color=color, fill=fill, dashes=dashes, width=width,
1253-
roundCap=roundCap, morph=morph)
1253+
lineCap=lineCap, lineJoin=lineJoin, morph=morph, roundCap=roundCap)
12541254
img.commit(overlay)
12551255

12561256
return Q
12571257

12581258
def drawCurve(page, p1, p2, p3, color=None, fill=None, dashes=None,
1259-
width=1, morph=None, closePath=False,
1260-
roundCap=False, overlay=True):
1259+
width=1, morph=None, roundCap=None, closePath=False,
1260+
lineCap=0, lineJoin=0, overlay=True):
12611261
"""Draw a special Bezier curve from p1 to p3, generating control points on lines p1 to p2 and p2 to p3.
12621262
"""
12631263
img = page.newShape()
12641264
Q = img.drawCurve(Point(p1), Point(p2), Point(p3))
12651265
img.finish(color=color, fill=fill, dashes=dashes, width=width,
1266-
roundCap=roundCap, morph=morph, closePath=closePath)
1266+
lineCap=lineCap, lineJoin=lineJoin, morph=morph, roundCap=roundCap, closePath=closePath)
12671267
img.commit(overlay)
12681268

12691269
return Q
12701270

12711271
def drawBezier(page, p1, p2, p3, p4, color=None, fill=None,
1272-
dashes=None, width=1, morph=None,
1273-
closePath=False, roundCap=False, overlay=True):
1272+
dashes=None, width=1, morph=None, roundCap=None,
1273+
closePath=False, lineCap=0, lineJoin=0, overlay=True):
12741274
"""Draw a general cubic Bezier curve from p1 to p4 using control points p2 and p3.
12751275
"""
12761276
img = page.newShape()
12771277
Q = img.drawBezier(Point(p1), Point(p2), Point(p3), Point(p4))
12781278
img.finish(color=color, fill=fill, dashes=dashes, width=width,
1279-
roundCap=roundCap, morph=morph, closePath=closePath)
1279+
lineCap=lineCap, lineJoin=lineJoin, morph=morph, roundCap=roundCap, closePath=closePath)
12801280
img.commit(overlay)
12811281

12821282
return Q
12831283

12841284
def drawSector(page, center, point, beta, color=None, fill=None,
1285-
dashes=None, fullSector=True, morph=None,
1286-
width=1, closePath=False, roundCap=False, overlay=True):
1285+
dashes=None, fullSector=True, morph=None, roundCap=None,
1286+
width=1, closePath=False, lineCap=0, lineJoin=0, overlay=True):
12871287
""" Draw a circle sector given circle center, one arc end point and the angle of the arc.
12881288
12891289
Parameters:
@@ -1295,7 +1295,7 @@ def drawSector(page, center, point, beta, color=None, fill=None,
12951295
img = page.newShape()
12961296
Q = img.drawSector(Point(center), Point(point), beta, fullSector=fullSector)
12971297
img.finish(color=color, fill=fill, dashes=dashes, width=width,
1298-
roundCap=roundCap, morph=morph, closePath=closePath)
1298+
lineCap=lineCap, lineJoin=lineJoin, morph=morph, roundCap=roundCap, closePath=closePath)
12991299
img.commit(overlay)
13001300

13011301
return Q
@@ -2060,11 +2060,13 @@ def updateRect(self, x):
20602060

20612061
else:
20622062
if len(x) == 2:
2063+
x = Point(x)
20632064
self.rect.x0 = min(self.rect.x0, x.x)
20642065
self.rect.y0 = min(self.rect.y0, x.y)
20652066
self.rect.x1 = max(self.rect.x1, x.x)
20662067
self.rect.y1 = max(self.rect.y1, x.y)
20672068
else:
2069+
x = Rect(x)
20682070
self.rect.x0 = min(self.rect.x0, x.x0)
20692071
self.rect.y0 = min(self.rect.y0, x.y0)
20702072
self.rect.x1 = max(self.rect.x1, x.x1)
@@ -2742,7 +2744,9 @@ def finish(
27422744
width=1,
27432745
color=None,
27442746
fill=None,
2745-
roundCap=False,
2747+
lineCap=0,
2748+
lineJoin=0,
2749+
roundCap=None,
27462750
dashes=None,
27472751
even_odd=False,
27482752
morph=None,
@@ -2757,15 +2761,22 @@ def finish(
27572761
"""
27582762
if self.draw_cont == "": # treat empty contents as no-op
27592763
return
2760-
2764+
if roundCap is not None:
2765+
warnings.warn("roundCap is replaced by lineCap / lineJoin", DeprecationWarning)
2766+
lineCap = lineJoin = roundCap
2767+
2768+
if width == 0: # border color makes no sense then
2769+
color = None
2770+
elif color is None: # vice versa
2771+
width = 0
27612772
color_str = ColorCode(color, "c") # ensure proper color string
27622773
fill_str = ColorCode(fill, "f") # ensure proper fill string
27632774

2764-
if width != 1:
2775+
if width not in (0, 1):
27652776
self.draw_cont += "%g w\n" % width
27662777

2767-
if roundCap:
2768-
self.draw_cont += "%i J %i j\n" % (roundCap, roundCap)
2778+
if lineCap + lineJoin > 0:
2779+
self.draw_cont += "%i J %i j\n" % (lineCap, lineJoin)
27692780

27702781
if dashes is not None and len(dashes) > 0:
27712782
self.draw_cont += "%s d\n" % dashes
@@ -2779,10 +2790,16 @@ def finish(
27792790

27802791
if fill is not None:
27812792
self.draw_cont += fill_str
2782-
if not even_odd:
2783-
self.draw_cont += "B\n"
2793+
if color is not None:
2794+
if not even_odd:
2795+
self.draw_cont += "B\n"
2796+
else:
2797+
self.draw_cont += "B*\n"
27842798
else:
2785-
self.draw_cont += "B*\n"
2799+
if not even_odd:
2800+
self.draw_cont += "f\n"
2801+
else:
2802+
self.draw_cont += "f*\n"
27862803
else:
27872804
self.draw_cont += "S\n"
27882805

fitz/version.i

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
%pythoncode %{
22
VersionFitz = "1.14.0"
33
VersionBind = "1.14.15"
4-
VersionDate = "2019-04-29 07:25:13"
5-
version = (VersionBind, VersionFitz, "20190429072513")
4+
VersionDate = "2019-05-22 14:26:15"
5+
version = (VersionBind, VersionFitz, "20190522142615")
66
%}

nano_setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060

6161
setup(
6262
name="PyMuPDF",
63-
version="1.14.15",
63+
version="1.15.0",
6464
description="Python bindings for the PDF rendering library MuPDF",
6565
classifiers=[
6666
"Development Status :: 5 - Production/Stable",

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373

7474
setup(
7575
name="PyMuPDF",
76-
version="1.14.15",
76+
version="1.15.0",
7777
description="Python bindings for the PDF rendering library MuPDF",
7878
long_description=long_desc,
7979
classifiers=classifier,

0 commit comments

Comments
 (0)