Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

README.md: fixed broken link into PyMuPDF-Utilities. #2103

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
48 changes: 37 additions & 11 deletions docs/installation.rst
Expand Up @@ -67,27 +67,53 @@ There are no **mandatory** external dependencies. However, some optional feature
Install from source without using an sdist
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

First get a PyMuPDF source tree:
* First get a PyMuPDF source tree:

* Clone the git repository at https://github.com/pymupdf/PyMuPDF,
for example::
* Clone the git repository at https://github.com/pymupdf/PyMuPDF,
for example::

git clone https://github.com/pymupdf/PyMuPDF.git

* Or download a ``.zip`` or ``.tar.gz`` source release from
https://github.com/pymupdf/PyMuPDF/releases.
* Or download and extract a ``.zip`` or ``.tar.gz`` source release from
https://github.com/pymupdf/PyMuPDF/releases.

Install SWIG etc as described above, then build PyMuPDF::
* Install C/C++ development tools and SWIG as described above.

cd PyMuPDF && python setup.py install
* Build and install PyMuPDF::

* This will automatically download a specific hard-coded MuPDF source release,
cd PyMuPDF && python setup.py install

This will automatically download a specific hard-coded MuPDF source release,
and build it into PyMuPDF.

One can build with a non-default MuPDF (for example one installed on the
system, or a local checkout) by setting environmental variables. See the
comments at the start of ``PyMuPDF/setup.py`` for more information.

.. note:: When running Python scripts that use PyMuPDF, make sure that the
current directory is not the ``PyMuPDF/`` directory.

Otherwise, confusingly, Python will attempt to import ``fitz`` from the local
``fitz/`` directory, which will fail because it only contains source files.


Running tests
~~~~~~~~~~~~~

PyMuPDF has a set of ``pytest`` scripts within the ``tests/`` directory.

Run tests with::

pip install pytest fontTools
pytest PyMuPDF/tests

* One can build with a different MuPDF (for example one installed on the
system, or a local custom build) by setting environmental variables.
If PyMuPDF has been built with a non-default build of MuPDF (using
environmental variable ``PYMUPDF_SETUP_MUPDF_BUILD``), it is possible that
``tests/test_textbox.py:test_textbox3()`` will fail, because it relies on MuPDF
having been built with PyMuPDF's customized configuration, ``fitz/_config.h``.

* See the documentation at the start of ``setup.py`` for more information.
One can skip this particular test by adding ``-k 'not test_textbox3'`` to the
``pytest`` command line.


Enabling Integrated OCR Support
Expand Down