Release date: December, 2016
- Ruikai Liu
- Jorj X. McKie
This is version 1.10.0 of PyMuPDF (formerly python-fitz), a Python binding which supports MuPDF 1.10a - "a lightweight PDF and XPS viewer".
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.
With PyMuPDF you therefore can also access files with extensions
*.epub from your Python scripts.
See the Wiki for more info/news/release notes/etc.
If you had not previously installed MuPDF, you must first do this. This process highly depends on your system. For most platforms, the MuPDF source contains prepared procedures on how to achieve this. Linux distributions usually also provide their own ways on how to install MuPDF. See below for more details.
Once MuPDF is in place, installing PyMuPDF comes down to running the usual
python setup.py install.
Also refer to this document for details.
Since MuPDF v1.10a is not available yet in the official repo, you need to first build it from source. Make sure to add
-fPIC to CFLAGS when compiling.
When MuPDF is ready, edit
setup.py in PyMuPDF and comment out the line of
library_dirs= to specify the directory which contains
libmupdf.a and other 3rd party libraries. Remove
setup.py if it complains.
First, install the MuPDF headers and libraries, which are provided by mupdf-tools:
brew install mupdf-tools
Then you might need to
export ARCHFLAGS='-arch x86_64' since
libmupdf.a is for x86_64 only.
Finally, please double check
setup.py before building. Update
library_dirs if necessary.
If you want to make your own binary however, have a look at this Wiki page. It explains how to use Visual Studio for generating MuPDF in quite some detail. Also do not hesitate to contact us if you need help.
Usage and Documentation
You have a variety of options to access the documentation:
- You can view it online at PyPI.
- You can download a Windows compiled html.
- You can download a PDF.
- You can download a HTML ZIP file.
- PyMuPDF Version 1.9.3
- PyMuPDF Version 1.9.2
- PyMuPDF Version 1.9.1
- Code compatible with MuPDF v1.8
- Code compatible with MuPDF v1.7a
- Code compatible with MuPDF v1.2
PyMuPDF is distributed under GNU GPL V3.
You can also find PyMuPDF on the Python Package Index PyPI.
We invite you to join our efforts by contributing to the the wiki pages.