Skip to content

Commit 748394c

Browse files
committed
Publish v1.13.5: extended PDF form fields support
1 parent 2468e64 commit 748394c

17 files changed

+2538
-593
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ install:
3939
- "$PIP install cibuildwheel==0.8.0"
4040
- mkdir mupdf && wget -q $MUPDF -O - | tar zx -C mupdf --strip-components=1
4141
- cp fitz/_mupdf_config.h mupdf/include/mupdf/fitz/config.h
42+
- cp fitz/_pdf-op-filter.c mupdf/source/pdf/pdf-op-filter.c
4243
script:
4344
- export CIBW_ENVIRONMENT='CFLAGS="-fPIC -std=gnu99"'
4445
- export CIBW_SKIP="cp33-* *i686"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# PyMuPDF 1.13.4 [![Build Status](https://travis-ci.org/rk700/PyMuPDF.svg?branch=master)](https://travis-ci.org/rk700/PyMuPDF)
1+
# PyMuPDF 1.13.5 [![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: May 11, 2018
1010

1111
# Introduction
1212

13-
This is **version 1.13.4 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.5 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

demo/README.md

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,30 @@
22

33
Program | Purpose
44
------- | -------
5-
[caustic.py](https://github.com/rk700/pymupdf/blob/master/demo/caustic.py) | demo producing a PDF with a caustic image
6-
[check-fields.py](https://github.com/rk700/pymupdf/blob/master/demo/check-fields.py) | prints field information for a Form PDF
7-
[demo.py](https://github.com/rk700/pymupdf/blob/master/demo/demo.py) | demonstrates a broad range of PyMuPDF high-level functions
8-
[demo-lowlevel.py](https://github.com/rk700/pymupdf/blob/master/demo/demo-lowlevel.py) | demonstrates PyMuPDF low-level functions
9-
[draw-sines.py](https://github.com/rk700/pymupdf/blob/master/demo/draw-sines.py) | draw sine / cosine functions
10-
[extract-img1.py](https://github.com/rk700/pymupdf/blob/master/demo/extract_img1.py) | PDF only: extracts all **page-referenced** images as PNG files
11-
[extract-img2.py](https://github.com/rk700/pymupdf/blob/master/demo/extract_img2.py) | PDF only: extracts **all** (valid) images as PNG files
12-
[extract-img3.py](https://github.com/rk700/pymupdf/blob/master/demo/extract_img3.py) | PDF only: extracts page images using raw image buffers (variable extensions)
13-
[extract-img4.py](https://github.com/rk700/pymupdf/blob/master/demo/extract_img4.py) | Any Document type: extracts page images (with variable extensions) using the v1.13.1 getText("dict") method
14-
[fitz2PIL.py](https://github.com/rk700/pymupdf/blob/master/demo/fitz2PIL.py) | save a pixmap as a PIL / Pillow supported file
15-
[PIL2fitz.py](https://github.com/rk700/pymupdf/blob/master/demo/PIL2fitz.py) | create a pixmap from any PIL / Pillow supported file
16-
[numpy2fitz.py](https://github.com/rk700/pymupdf/blob/master/demo/numpy2fitz.py) | how to create pixmaps from NumPy arrays
17-
[PDFdisplay.py](https://github.com/rk700/pymupdf/blob/master/demo/PDFdisplay.py) | display a document using wxPython
18-
[pdfviewer(wx).py](https://github.com/rk700/pymupdf/blob/master/demo/pdfviewer(wx).py) | alternative wxPython viewer
19-
[pencil.py](https://github.com/rk700/pymupdf/blob/master/demo/pencil.py) | create the pencil of the ReportLab User Guide with PyMuPDF
20-
[piechart1.py](https://github.com/rk700/pymupdf/blob/master/demo/piechart1.py) | create a circular pie chart
21-
[piechart2.py](https://github.com/rk700/pymupdf/blob/master/demo/piechart2.py) | create a semi-circular pie chart
22-
[pixmap-tiles.py](https://github.com/rk700/pymupdf/blob/master/demo/pixmap.py) | use pixmap to create tiled copies of an image file
23-
[decrypt.py](https://github.com/rk700/pymupdf/blob/master/demo/removePass.py) | create a decrypted copy of a PDF file
24-
[sierpinski.py](https://github.com/rk700/pymupdf/blob/master/demo/sierpinski.py) | create a Sierpinski carpet (fractal) fast with pixmaps
25-
[splitter.py](https://github.com/rk700/pymupdf/blob/master/demo/splitter.py) | split a PDF into its pages (1 PDF per page)
26-
[fitz-logo.py](https://github.com/rk700/pymupdf/blob/master/demo/svg-logo.py) | put any document as logo an each PDF page.
27-
[svg-logo.py](https://github.com/rk700/pymupdf/blob/master/demo/svg-logo.py) | put an SVG as logo an each PDF page.
28-
[spumoni.py](https://github.com/rk700/pymupdf/blob/master/demo/spumoni.py) | create the ReportLab drawing on page 26 with PyMuPDF
29-
[text2pdf.py](https://github.com/rk700/pymupdf/blob/master/demo/text2pdf.py) | convert a text file to PDF
30-
[wavy-polygon.py](https://github.com/rk700/pymupdf/blob/master/demo/wavy-polygon.py) | draw a regular polygon with curly borders
31-
[xps-converter.py](https://github.com/rk700/pymupdf/blob/master/demo/xps-converter.py) | convert arbitrary documents to PDF (XPS, EPUB, etc.)
5+
caustic.py | demo producing a PDF with the catacaustic
6+
list-fields.py | prints field information for a Form PDF
7+
demo.py | demonstrates a broad range of PyMuPDF high-level functions
8+
demo-lowlevel.py | demonstrates PyMuPDF low-level functions
9+
draw-sines.py | draw sine / cosine functions
10+
extract-img1.py | PDF only: extracts all **page-referenced** images as PNG files
11+
extract-img2.py | PDF only: extracts **all** (valid) images as PNG files
12+
extract-img3.py | PDF only: extracts page images using raw image buffers (variable extensions)
13+
extract-img4.py | Any Document type: extracts page images (with variable extensions) using the v1.13.1 getText("dict") method
14+
fitz2PIL.py | save a pixmap as a PIL / Pillow supported file
15+
PIL2fitz.py | create a pixmap from any PIL / Pillow supported file
16+
numpy2fitz.py | how to create pixmaps from NumPy arrays
17+
PDFdisplay.py | display a document using wxPython
18+
pdfviewer(wx).py | alternative wxPython viewer
19+
pencil.py | create the pencil of the ReportLab User Guide with PyMuPDF
20+
piechart1.py | create a circular pie chart
21+
piechart2.py | create a semi-circular pie chart
22+
pixmap-tiles.py | use pixmap to create tiled copies of an image file
23+
decrypt.py | create a decrypted copy of a PDF file
24+
sierpinski.py | create a Sierpinski carpet (fractal) fast with pixmaps
25+
splitter.py | split a PDF into its pages (1 PDF per page)
26+
fitz-logo.py | put any document as logo an each PDF page.
27+
svg-logo.py | put an SVG as logo an each PDF page.
28+
spumoni.py | create the ReportLab drawing on page 26 with PyMuPDF
29+
text2pdf.py | convert a text file to PDF
30+
wavy-polygon.py | draw a regular polygon with curly borders
31+
xps-converter.py | convert arbitrary documents to PDF (XPS, EPUB, CBZ, etc.)

demo/check-fields.py

Lines changed: 0 additions & 27 deletions
This file was deleted.

demo/list-fields.py

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
"""
2+
A demo showing all PDF form fields of a document.
3+
"""
4+
import sys
5+
import fitz
6+
doc = fitz.open(sys.argv[1])
7+
if not doc.isFormPDF:
8+
raise SystemExit("PDF has no form fields.")
9+
for page in doc:
10+
a = page.firstAnnot
11+
header_shown = False
12+
13+
while a:
14+
if a.type[0] != fitz.ANNOT_WIDGET:
15+
a = a.next
16+
continue
17+
if not header_shown:
18+
print("\nShowing the form fields of page", page.number)
19+
print("".ljust(80, "-"))
20+
header_shown = True
21+
print("\nField type '%s', name '%s', value '%s'" % (a.widget_type[1],
22+
a.widget_name, a.widget_value))
23+
if a.widget_type[0] in (4, 5): # listbox / combobox
24+
print("... from possible values:", a.widget_choices, "\n")
25+
a = a.next
26+
27+
"""
28+
Above script may produce the following output:
29+
30+
Showing the form fields of page 0
31+
--------------------------------------------------------------------------------
32+
33+
Field type 'Text', name 'Given Name Text Box', value 'Jorj X.'
34+
35+
Field type 'Text', name 'Family Name Text Box', value 'McKie'
36+
37+
Field type 'Text', name 'Address 1 Text Box', value 'House near the Beach'
38+
39+
Field type 'Text', name 'House nr Text Box', value '4711'
40+
41+
Field type 'Text', name 'Address 2 Text Box', value 'A Secret Place'
42+
43+
Field type 'Text', name 'Postcode Text Box', value '314159'
44+
45+
Field type 'Text', name 'City Text Box', value 'Valetta'
46+
47+
Field type 'ComboBox', name 'Country Combo Box', value 'Malta'
48+
... from possible values: ['Austria', 'Belgium', 'Britain', 'Bulgaria', 'Croatia', 'Cyprus', 'Czech-Republic', 'Denmark', 'Estonia', 'Finland', 'France', 'Germany', 'Greece', 'Hungary', 'Ireland', 'Italy', 'Latvia', 'Lithuania', 'Luxembourg', 'Malta', 'Netherlands', 'Poland', 'Portugal', 'Romania', 'Slovakia', 'Slovenia', 'Spain', 'Sweden']
49+
50+
51+
Field type 'ComboBox', name 'Gender List Box', value 'Man'
52+
... from possible values: ['Man', 'Woman']
53+
54+
55+
Field type 'Text', name 'Height Formatted Field', value '180'
56+
57+
Field type 'CheckBox', name 'Driving License Check Box', value 'True'
58+
59+
Field type 'CheckBox', name 'Language 1 Check Box', value 'True'
60+
61+
Field type 'CheckBox', name 'Language 2 Check Box', value 'True'
62+
63+
Field type 'CheckBox', name 'Language 3 Check Box', value 'False'
64+
65+
Field type 'CheckBox', name 'Language 4 Check Box', value 'False'
66+
67+
Field type 'CheckBox', name 'Language 5 Check Box', value 'False'
68+
69+
Field type 'ComboBox', name 'Favourite Colour List Box', value 'Blue'
70+
... from possible values: ['Black', 'Brown', 'Red', 'Orange', 'Yellow', 'Green', 'Blue', 'Violet', 'Grey', 'White']
71+
"""

doc/PyMuPDF.pdf

5.78 KB
Binary file not shown.

doc/html.zip

10.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)