Skip to content

Commit 0bd2dbf

Browse files
committed
Uploading v1.13.15
1 parent 42c8391 commit 0bd2dbf

File tree

10 files changed

+192
-265
lines changed

10 files changed

+192
-265
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# PyMuPDF 1.13.14 [![Build Status](https://travis-ci.org/rk700/PyMuPDF.svg?branch=master)](https://travis-ci.org/rk700/PyMuPDF)
1+
# PyMuPDF 1.13.15 [![Build Status](https://travis-ci.org/rk700/PyMuPDF.svg?branch=master)](https://travis-ci.org/rk700/PyMuPDF)
22

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

@@ -10,7 +10,7 @@ Release date: July 19, 2018
1010

1111
# Introduction
1212

13-
This is **version 1.13.14 of PyMuPDF (formerly python-fitz)**, a Python binding with support for [MuPDF 1.13.0](http://mupdf.com/) - "a lightweight PDF and XPS viewer".
13+
This is **version 1.13.15 of PyMuPDF (formerly python-fitz)**, a Python binding with support for [MuPDF 1.13.0](http://mupdf.com/) - "a lightweight PDF and XPS viewer".
1414

1515
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.
1616

doc/PyMuPDF.pdf

813 Bytes
Binary file not shown.

doc/html.zip

-314 Bytes
Binary file not shown.

fitz/fitz.i

Lines changed: 38 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@
114114
#include <pdf.h>
115115
#include <zlib.h>
116116
#include <time.h>
117+
#include <fitz/config.h>
117118
char *JM_Python_str_AsChar(PyObject *str);
118119
%}
119120

@@ -2667,7 +2668,6 @@ fannot._erase()
26672668
fz_append_string(gctx, nres, data);
26682669
fz_append_string(gctx, nres, " Do Q ");
26692670
2670-
//JM_extend_contents(gctx, pdfout, tpageref, nres, overlay);
26712671
JM_insert_contents(gctx, pdfout, tpageref, nres, overlay);
26722672
fz_drop_buffer(gctx, nres);
26732673
}
@@ -5397,79 +5397,65 @@ struct fz_annot_s
53975397
PyObject *setInfo(PyObject *info)
53985398
{
53995399
pdf_annot *annot = pdf_annot_from_fz_annot(gctx, $self);
5400-
pdf_document *pdf = NULL;
5401-
if (annot) pdf = annot->page->doc;
5402-
PyObject *value = NULL;
54035400
char *uc = NULL;
5404-
// ensure we have valid dictionary keys ...
5405-
int dictvalid = checkDictKeys(info, "content", "title", "modDate", "creationDate", "subject", "name", 0);
5401+
54065402
// use this to indicate a 'markup' annot type
54075403
int is_markup = pdf_annot_has_author(gctx, annot);
54085404
fz_var(is_markup);
54095405
fz_var(annot);
5410-
fz_var(pdf);
54115406
fz_try(gctx)
54125407
{
54135408
assert_PDF(annot);
54145409
if (!PyDict_Check(info))
54155410
THROWMSG("info not a dict");
5416-
if (!dictvalid)
5417-
THROWMSG("invalid key in info dict");
54185411

54195412
// contents
5420-
value = PyDict_GetItemString(info, "content");
5421-
if (value)
5413+
uc = JM_Python_str_AsChar(PyDict_GetItemString(info, "content"));
5414+
if (uc)
54225415
{
5423-
uc = JM_Python_str_AsChar(value);
5424-
if (uc) pdf_set_annot_contents(gctx, annot, uc);
5416+
pdf_set_annot_contents(gctx, annot, uc);
54255417
JM_Python_str_DelForPy3(uc);
54265418
}
5427-
Py_XDECREF(value);
54285419

5429-
// title (= author)
5430-
value = PyDict_GetItemString(info, "title");
5431-
if (value && is_markup)
5420+
if (is_markup)
54325421
{
5433-
uc = JM_Python_str_AsChar(value);
5434-
if (uc) pdf_set_annot_author(gctx, annot, uc);
5435-
JM_Python_str_DelForPy3(uc);
5436-
}
5437-
Py_XDECREF(value);
5422+
// title (= author)
5423+
uc = JM_Python_str_AsChar(PyDict_GetItemString(info, "title"));
5424+
if (uc)
5425+
{
5426+
pdf_set_annot_author(gctx, annot, uc);
5427+
JM_Python_str_DelForPy3(uc);
5428+
}
54385429

5439-
// creation date
5440-
value = PyDict_GetItemString(info, "creationDate");
5441-
if (value && is_markup)
5442-
{
5443-
uc = JM_Python_str_AsChar(value);
5444-
if (uc) pdf_dict_puts_drop(gctx, annot->obj, "CreationDate",
5445-
pdf_new_string(gctx, pdf, uc, strlen(uc)));
5446-
JM_Python_str_DelForPy3(uc);
5447-
}
5448-
Py_XDECREF(value);
5430+
// creation date
5431+
uc = JM_Python_str_AsChar(PyDict_GetItemString(info,
5432+
"creationDate"));
5433+
if (uc)
5434+
{
5435+
pdf_dict_put_text_string(gctx, annot->obj,
5436+
PDF_NAME_CreationDate, uc);
5437+
JM_Python_str_DelForPy3(uc);
5438+
}
54495439

5450-
// mod date
5451-
value = PyDict_GetItemString(info, "modDate");
5452-
if (value && is_markup)
5453-
{
5454-
uc = JM_Python_str_AsChar(value);
5455-
if (uc) pdf_dict_put_drop(gctx, annot->obj, PDF_NAME_M,
5456-
pdf_new_string(gctx, pdf, uc, strlen(uc)));
5457-
JM_Python_str_DelForPy3(uc);
5458-
}
5459-
Py_XDECREF(value);
5440+
// mod date
5441+
uc = JM_Python_str_AsChar(PyDict_GetItemString(info, "modDate"));
5442+
if (uc)
5443+
{
5444+
pdf_dict_put_text_string(gctx, annot->obj,
5445+
PDF_NAME_M, uc);
5446+
JM_Python_str_DelForPy3(uc);
5447+
}
54605448

5461-
// subject
5462-
value = PyDict_GetItemString(info, "subject");
5463-
if (value && is_markup)
5464-
{
5465-
uc = JM_Python_str_AsChar(value);
5466-
if (uc) pdf_dict_puts_drop(gctx, annot->obj, "Subj",
5467-
pdf_new_string(gctx, pdf, uc, strlen(uc)));
5468-
JM_Python_str_DelForPy3(uc);
5449+
// subject
5450+
uc = JM_Python_str_AsChar(PyDict_GetItemString(info, "subject"));
5451+
if (uc)
5452+
{
5453+
pdf_dict_puts_drop(gctx, annot->obj, "Subj",
5454+
pdf_new_text_string(gctx, NULL, uc));
5455+
JM_Python_str_DelForPy3(uc);
5456+
}
54695457
}
5470-
Py_XDECREF(value);
54715458
}
5472-
fz_always(gctx) Py_XDECREF(value);
54735459
fz_catch(gctx) return NULL;
54745460
return NONE;
54755461
}

fitz/fitz.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ class _object:
102102

103103

104104
VersionFitz = "1.13.0"
105-
VersionBind = "1.13.14"
106-
VersionDate = "2018-07-19 15:44:39"
107-
version = (VersionBind, VersionFitz, "20180719154439")
105+
VersionBind = "1.13.15"
106+
VersionDate = "2018-07-25 23:50:27"
107+
version = (VersionBind, VersionFitz, "20180725235027")
108108

109109

110110
#------------------------------------------------------------------------------
@@ -3845,6 +3845,11 @@ def glyph_cache_empty(self):
38453845
return _fitz.Tools_glyph_cache_empty(self)
38463846

38473847

3848+
def font_config(self):
3849+
"""font_config(self) -> PyObject *"""
3850+
return _fitz.Tools_font_config(self)
3851+
3852+
38483853
def __init__(self):
38493854
"""__init__(self) -> Tools"""
38503855
this = _fitz.new_Tools()

0 commit comments

Comments
 (0)