Repository: rk700/PyMuPDF
Branch: main
Commit: ae19b1ad6ce0
Files: 589
Total size: 9.1 MB
Directory structure:
gitextract_dv05yjlp/
├── .gitattributes
├── .github/
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug_report.yml
│ │ └── feature_request.md
│ └── workflows/
│ ├── build_wheels.yml
│ ├── cla.yml
│ ├── test-valgrind.yml
│ ├── test.yml
│ ├── test_multiple.yml
│ ├── test_pyodide.yml
│ ├── test_quick.yml
│ └── test_sysinstall.yml
├── .gitignore
├── .python-version
├── .readthedocs.yaml
├── .vs/
│ ├── ProjectSettings.json
│ ├── PyMuPDF/
│ │ └── v15/
│ │ └── .suo
│ └── VSWorkspaceState.json
├── COPYING
├── README.md
├── READMEb.md
├── READMEd.md
├── changes.txt
├── docs/
│ ├── 404.rst
│ ├── README.md
│ ├── _static/
│ │ ├── custom.css
│ │ └── prism/
│ │ ├── prism.css
│ │ ├── prism.html
│ │ └── prism.js
│ ├── about-feature-matrix.rst
│ ├── about-performance.rst
│ ├── about.rst
│ ├── algebra.rst
│ ├── annot.rst
│ ├── app1.rst
│ ├── app2.rst
│ ├── app3.rst
│ ├── app4.rst
│ ├── archive-class.rst
│ ├── changes.rst
│ ├── classes.rst
│ ├── colors.rst
│ ├── colorspace.rst
│ ├── conf.py
│ ├── converting-files.rst
│ ├── coop_low.rst
│ ├── device.rst
│ ├── displaylist.rst
│ ├── document-writer-class.rst
│ ├── document.rst
│ ├── extensions/
│ │ ├── __init__.py
│ │ ├── fulltoc.py
│ │ └── searchrepair.py
│ ├── faq/
│ │ └── index.rst
│ ├── faq.rst
│ ├── font.rst
│ ├── footer.rst
│ ├── functions.rst
│ ├── glossary.rst
│ ├── header-404.rst
│ ├── header.rst
│ ├── how-to-open-a-file.rst
│ ├── identity.rst
│ ├── index.rst
│ ├── installation.rst
│ ├── irect.rst
│ ├── link.rst
│ ├── linkdest.rst
│ ├── locales/
│ │ ├── ja/
│ │ │ ├── .readthedocs.yaml
│ │ │ └── LC_MESSAGES/
│ │ │ ├── 404.mo
│ │ │ ├── 404.po
│ │ │ ├── about-feature-matrix.mo
│ │ │ ├── about-feature-matrix.po
│ │ │ ├── about-performance.mo
│ │ │ ├── about-performance.po
│ │ │ ├── about.mo
│ │ │ ├── about.po
│ │ │ ├── algebra.mo
│ │ │ ├── algebra.po
│ │ │ ├── annot.mo
│ │ │ ├── annot.po
│ │ │ ├── app1.mo
│ │ │ ├── app1.po
│ │ │ ├── app2.mo
│ │ │ ├── app2.po
│ │ │ ├── app3.mo
│ │ │ ├── app3.po
│ │ │ ├── app4.mo
│ │ │ ├── app4.po
│ │ │ ├── archive-class.mo
│ │ │ ├── archive-class.po
│ │ │ ├── changes.mo
│ │ │ ├── changes.po
│ │ │ ├── classes.mo
│ │ │ ├── classes.po
│ │ │ ├── colors.mo
│ │ │ ├── colors.po
│ │ │ ├── colorspace.mo
│ │ │ ├── colorspace.po
│ │ │ ├── converting-files.mo
│ │ │ ├── converting-files.po
│ │ │ ├── coop_low.mo
│ │ │ ├── coop_low.po
│ │ │ ├── deprecated.mo
│ │ │ ├── deprecated.po
│ │ │ ├── device.mo
│ │ │ ├── device.po
│ │ │ ├── displaylist.mo
│ │ │ ├── displaylist.po
│ │ │ ├── document-writer-class.mo
│ │ │ ├── document-writer-class.po
│ │ │ ├── document.mo
│ │ │ ├── document.po
│ │ │ ├── faq.mo
│ │ │ ├── faq.po
│ │ │ ├── font.mo
│ │ │ ├── font.po
│ │ │ ├── footer.mo
│ │ │ ├── footer.po
│ │ │ ├── functions.mo
│ │ │ ├── functions.po
│ │ │ ├── glossary.mo
│ │ │ ├── glossary.po
│ │ │ ├── header-404.mo
│ │ │ ├── header-404.po
│ │ │ ├── header.mo
│ │ │ ├── header.po
│ │ │ ├── how-to-open-a-file.mo
│ │ │ ├── how-to-open-a-file.po
│ │ │ ├── identity.mo
│ │ │ ├── identity.po
│ │ │ ├── index.mo
│ │ │ ├── index.po
│ │ │ ├── installation.mo
│ │ │ ├── installation.po
│ │ │ ├── intro.mo
│ │ │ ├── intro.po
│ │ │ ├── irect.mo
│ │ │ ├── irect.po
│ │ │ ├── link.mo
│ │ │ ├── link.po
│ │ │ ├── linkdest.mo
│ │ │ ├── linkdest.po
│ │ │ ├── lowlevel.mo
│ │ │ ├── lowlevel.po
│ │ │ ├── matrix.mo
│ │ │ ├── matrix.po
│ │ │ ├── module.mo
│ │ │ ├── module.po
│ │ │ ├── outline.mo
│ │ │ ├── outline.po
│ │ │ ├── packaging.mo
│ │ │ ├── packaging.po
│ │ │ ├── page.mo
│ │ │ ├── page.po
│ │ │ ├── pixmap.mo
│ │ │ ├── pixmap.po
│ │ │ ├── point.mo
│ │ │ ├── point.po
│ │ │ ├── pymupdf-layout/
│ │ │ │ ├── index.mo
│ │ │ │ └── index.po
│ │ │ ├── pymupdf-pro/
│ │ │ │ ├── index.mo
│ │ │ │ └── index.po
│ │ │ ├── pymupdf-pro.mo
│ │ │ ├── pymupdf-pro.po
│ │ │ ├── pymupdf4llm/
│ │ │ │ ├── api.mo
│ │ │ │ ├── api.po
│ │ │ │ ├── index.mo
│ │ │ │ └── index.po
│ │ │ ├── pyodide.mo
│ │ │ ├── pyodide.po
│ │ │ ├── quad.mo
│ │ │ ├── quad.po
│ │ │ ├── rag.mo
│ │ │ ├── rag.po
│ │ │ ├── recipes-annotations.mo
│ │ │ ├── recipes-annotations.po
│ │ │ ├── recipes-common-issues-and-their-solutions.mo
│ │ │ ├── recipes-common-issues-and-their-solutions.po
│ │ │ ├── recipes-drawing-and-graphics.mo
│ │ │ ├── recipes-drawing-and-graphics.po
│ │ │ ├── recipes-images.mo
│ │ │ ├── recipes-images.po
│ │ │ ├── recipes-journalling.mo
│ │ │ ├── recipes-journalling.po
│ │ │ ├── recipes-low-level-interfaces.mo
│ │ │ ├── recipes-low-level-interfaces.po
│ │ │ ├── recipes-multiprocessing.mo
│ │ │ ├── recipes-multiprocessing.po
│ │ │ ├── recipes-ocr.mo
│ │ │ ├── recipes-ocr.po
│ │ │ ├── recipes-optional-content.mo
│ │ │ ├── recipes-optional-content.po
│ │ │ ├── recipes-stories.mo
│ │ │ ├── recipes-stories.po
│ │ │ ├── recipes-text.mo
│ │ │ ├── recipes-text.po
│ │ │ ├── recipes.mo
│ │ │ ├── recipes.po
│ │ │ ├── rect.mo
│ │ │ ├── rect.po
│ │ │ ├── resources.mo
│ │ │ ├── resources.po
│ │ │ ├── shape.mo
│ │ │ ├── shape.po
│ │ │ ├── story-class.mo
│ │ │ ├── story-class.po
│ │ │ ├── supported-files-table.mo
│ │ │ ├── supported-files-table.po
│ │ │ ├── textpage.mo
│ │ │ ├── textpage.po
│ │ │ ├── textwriter.mo
│ │ │ ├── textwriter.po
│ │ │ ├── the-basics.mo
│ │ │ ├── the-basics.po
│ │ │ ├── tools.mo
│ │ │ ├── tools.po
│ │ │ ├── tutorial.mo
│ │ │ ├── tutorial.po
│ │ │ ├── vars.mo
│ │ │ ├── vars.po
│ │ │ ├── version.mo
│ │ │ ├── version.po
│ │ │ ├── widget.mo
│ │ │ ├── widget.po
│ │ │ ├── xml-class.mo
│ │ │ ├── xml-class.po
│ │ │ ├── znames.mo
│ │ │ └── znames.po
│ │ └── ko/
│ │ ├── .readthedocs.yaml
│ │ └── LC_MESSAGES/
│ │ ├── 404.mo
│ │ ├── 404.po
│ │ ├── about-feature-matrix.mo
│ │ ├── about-feature-matrix.po
│ │ ├── about-performance.mo
│ │ ├── about-performance.po
│ │ ├── about.mo
│ │ ├── about.po
│ │ ├── algebra.mo
│ │ ├── algebra.po
│ │ ├── annot.mo
│ │ ├── annot.po
│ │ ├── app1.mo
│ │ ├── app1.po
│ │ ├── app2.mo
│ │ ├── app2.po
│ │ ├── app3.mo
│ │ ├── app3.po
│ │ ├── app4.mo
│ │ ├── app4.po
│ │ ├── archive-class.mo
│ │ ├── archive-class.po
│ │ ├── changes.mo
│ │ ├── changes.po
│ │ ├── classes.mo
│ │ ├── classes.po
│ │ ├── colors.mo
│ │ ├── colors.po
│ │ ├── colorspace.mo
│ │ ├── colorspace.po
│ │ ├── converting-files.mo
│ │ ├── converting-files.po
│ │ ├── coop_low.mo
│ │ ├── coop_low.po
│ │ ├── device.mo
│ │ ├── device.po
│ │ ├── displaylist.mo
│ │ ├── displaylist.po
│ │ ├── document-writer-class.mo
│ │ ├── document-writer-class.po
│ │ ├── document.mo
│ │ ├── document.po
│ │ ├── faq.mo
│ │ ├── faq.po
│ │ ├── font.mo
│ │ ├── font.po
│ │ ├── footer.mo
│ │ ├── footer.po
│ │ ├── functions.mo
│ │ ├── functions.po
│ │ ├── glossary.mo
│ │ ├── glossary.po
│ │ ├── header-404.mo
│ │ ├── header-404.po
│ │ ├── header.mo
│ │ ├── header.po
│ │ ├── how-to-open-a-file.mo
│ │ ├── how-to-open-a-file.po
│ │ ├── identity.mo
│ │ ├── identity.po
│ │ ├── index.mo
│ │ ├── index.po
│ │ ├── installation.mo
│ │ ├── installation.po
│ │ ├── irect.mo
│ │ ├── irect.po
│ │ ├── link.mo
│ │ ├── link.po
│ │ ├── linkdest.mo
│ │ ├── linkdest.po
│ │ ├── lowlevel.mo
│ │ ├── lowlevel.po
│ │ ├── matrix.mo
│ │ ├── matrix.po
│ │ ├── module.mo
│ │ ├── module.po
│ │ ├── outline.mo
│ │ ├── outline.po
│ │ ├── packaging.mo
│ │ ├── packaging.po
│ │ ├── page.mo
│ │ ├── page.po
│ │ ├── pixmap.mo
│ │ ├── pixmap.po
│ │ ├── point.mo
│ │ ├── point.po
│ │ ├── pymupdf-layout/
│ │ │ ├── index.mo
│ │ │ └── index.po
│ │ ├── pymupdf-pro/
│ │ │ ├── index.mo
│ │ │ └── index.po
│ │ ├── pymupdf4llm/
│ │ │ ├── api.mo
│ │ │ ├── api.po
│ │ │ ├── index.mo
│ │ │ └── index.po
│ │ ├── pyodide.mo
│ │ ├── pyodide.po
│ │ ├── quad.mo
│ │ ├── quad.po
│ │ ├── rag.mo
│ │ ├── rag.po
│ │ ├── recipes-annotations.mo
│ │ ├── recipes-annotations.po
│ │ ├── recipes-common-issues-and-their-solutions.mo
│ │ ├── recipes-common-issues-and-their-solutions.po
│ │ ├── recipes-drawing-and-graphics.mo
│ │ ├── recipes-drawing-and-graphics.po
│ │ ├── recipes-images.mo
│ │ ├── recipes-images.po
│ │ ├── recipes-journalling.mo
│ │ ├── recipes-journalling.po
│ │ ├── recipes-low-level-interfaces.mo
│ │ ├── recipes-low-level-interfaces.po
│ │ ├── recipes-multiprocessing.mo
│ │ ├── recipes-multiprocessing.po
│ │ ├── recipes-ocr.mo
│ │ ├── recipes-ocr.po
│ │ ├── recipes-optional-content.mo
│ │ ├── recipes-optional-content.po
│ │ ├── recipes-stories.mo
│ │ ├── recipes-stories.po
│ │ ├── recipes-text.mo
│ │ ├── recipes-text.po
│ │ ├── recipes.mo
│ │ ├── recipes.po
│ │ ├── rect.mo
│ │ ├── rect.po
│ │ ├── resources.mo
│ │ ├── resources.po
│ │ ├── shape.mo
│ │ ├── shape.po
│ │ ├── story-class.mo
│ │ ├── story-class.po
│ │ ├── supported-files-table.mo
│ │ ├── supported-files-table.po
│ │ ├── textpage.mo
│ │ ├── textpage.po
│ │ ├── textwriter.mo
│ │ ├── textwriter.po
│ │ ├── the-basics.mo
│ │ ├── the-basics.po
│ │ ├── tools.mo
│ │ ├── tools.po
│ │ ├── tutorial.mo
│ │ ├── tutorial.po
│ │ ├── vars.mo
│ │ ├── vars.po
│ │ ├── version.mo
│ │ ├── version.po
│ │ ├── widget.mo
│ │ ├── widget.po
│ │ ├── xml-class.mo
│ │ ├── xml-class.po
│ │ ├── znames.mo
│ │ └── znames.po
│ ├── lowlevel.rst
│ ├── matrix.rst
│ ├── module.rst
│ ├── ocr/
│ │ └── tesseract-language-packs.rst
│ ├── outline.rst
│ ├── packaging.rst
│ ├── page.rst
│ ├── pixmap.rst
│ ├── point.rst
│ ├── pymupdf-pro/
│ │ └── index.rst
│ ├── pymupdf4llm/
│ │ ├── api.rst
│ │ ├── index.rst
│ │ └── ocr-plugins.rst
│ ├── pyodide.rst
│ ├── quad.rst
│ ├── rag.rst
│ ├── recipes-annotations.rst
│ ├── recipes-common-issues-and-their-solutions.rst
│ ├── recipes-drawing-and-graphics.rst
│ ├── recipes-images.rst
│ ├── recipes-journalling.rst
│ ├── recipes-low-level-interfaces.rst
│ ├── recipes-multiprocessing.rst
│ ├── recipes-ocr.rst
│ ├── recipes-optional-content.rst
│ ├── recipes-stories.rst
│ ├── recipes-text.rst
│ ├── recipes.rst
│ ├── rect.rst
│ ├── requirements.txt
│ ├── resources.rst
│ ├── samples/
│ │ ├── annotations-freetext1.py
│ │ ├── annotations-freetext2.py
│ │ ├── annotations-ink.py
│ │ ├── code-printer.py
│ │ ├── filmfestival-sql.py
│ │ ├── json-example.py
│ │ ├── multiprocess-gui.py
│ │ ├── multiprocess-render.py
│ │ ├── national-capitals.py
│ │ ├── new-annots.py
│ │ ├── quickfox-image-no-go.py
│ │ ├── quickfox.py
│ │ ├── showpdf-page.py
│ │ ├── simple-grid.py
│ │ ├── story-write-stabilized-links.py
│ │ ├── story-write-stabilized.py
│ │ ├── story-write.py
│ │ ├── table01.py
│ │ └── text-lister.py
│ ├── shape.rst
│ ├── story-class.rst
│ ├── supported-files-table.rst
│ ├── textpage.rst
│ ├── textwriter.rst
│ ├── the-basics.rst
│ ├── tools.rst
│ ├── tutorial.rst
│ ├── vars.rst
│ ├── version.rst
│ ├── widget.rst
│ ├── xml-class.rst
│ └── znames.rst
├── pyproject.toml
├── pytest.ini
├── scripts/
│ ├── gh_release.py
│ ├── sysinstall.py
│ └── test.py
├── setup.py
├── src/
│ ├── __init__.py
│ ├── __main__.py
│ ├── _apply_pages.py
│ ├── _wxcolors.py
│ ├── extra.i
│ ├── fitz___init__.py
│ ├── fitz_table.py
│ ├── fitz_utils.py
│ ├── pipcl.py
│ ├── pymupdf.py
│ ├── table.py
│ ├── utils.py
│ └── wdev.py
├── src_classic/
│ ├── __init__.py
│ ├── __main__.py
│ ├── _config.h
│ ├── fitz_old.i
│ ├── helper-annot.i
│ ├── helper-convert.i
│ ├── helper-defines.i
│ ├── helper-devices.i
│ ├── helper-fields.i
│ ├── helper-fileobj.i
│ ├── helper-geo-c.i
│ ├── helper-geo-py.i
│ ├── helper-globals.i
│ ├── helper-other.i
│ ├── helper-pdfinfo.i
│ ├── helper-pixmap.i
│ ├── helper-portfolio.i
│ ├── helper-python.i
│ ├── helper-select.i
│ ├── helper-stext.i
│ ├── helper-xobject.i
│ ├── utils.py
│ └── version.i
├── tests/
│ ├── README.md
│ ├── conftest.py
│ ├── gentle_compare.py
│ ├── resources/
│ │ ├── Bezier.epub
│ │ ├── PragmaticaC.otf
│ │ ├── chinese-tables.pickle
│ │ ├── cython.pickle
│ │ ├── full_toc.txt
│ │ ├── metadata.txt
│ │ ├── simple_toc.txt
│ │ ├── symbols.txt
│ │ ├── test_2608_expected
│ │ ├── test_2608_expected_1.26
│ │ ├── test_2608_expected_1.28
│ │ ├── test_3493.epub
│ │ ├── test_3615.epub
│ │ ├── test_3654.docx
│ │ ├── test_3687-3.epub
│ │ ├── test_3687.epub
│ │ ├── test_3842_expected_1.28.txt
│ │ ├── test_3842_partial.txt
│ │ ├── test_4496.hwpx
│ │ ├── test_open2.cbz
│ │ ├── test_open2.doc
│ │ ├── test_open2.docx
│ │ ├── test_open2.epub
│ │ ├── test_open2.fb2
│ │ ├── test_open2.html
│ │ ├── test_open2.mobi
│ │ ├── test_open2.xhtml
│ │ ├── test_open2.xml
│ │ ├── test_open2.xps
│ │ └── test_open2_expected.json
│ ├── run_compound.py
│ ├── test_2548.py
│ ├── test_2634.py
│ ├── test_2904.py
│ ├── test_2907.py
│ ├── test_4141.py
│ ├── test_4503.py
│ ├── test_4505.py
│ ├── test_4520.py
│ ├── test_4614.py
│ ├── test_4716.py
│ ├── test_4767.py
│ ├── test_4942.py
│ ├── test_annots.py
│ ├── test_badfonts.py
│ ├── test_balance_count.py
│ ├── test_barcode.py
│ ├── test_clip_page.py
│ ├── test_cluster_drawings.py
│ ├── test_codespell.py
│ ├── test_crypting.py
│ ├── test_docs_samples.py
│ ├── test_drawings.py
│ ├── test_embeddedfiles.py
│ ├── test_extractimage.py
│ ├── test_flake8.py
│ ├── test_font.py
│ ├── test_general.py
│ ├── test_geometry.py
│ ├── test_imagebbox.py
│ ├── test_imagemasks.py
│ ├── test_import.py
│ ├── test_insertimage.py
│ ├── test_insertpdf.py
│ ├── test_linebreaks.py
│ ├── test_linequad.py
│ ├── test_memory.py
│ ├── test_metadata.py
│ ├── test_mupdf_regressions.py
│ ├── test_named_links.py
│ ├── test_nonpdf.py
│ ├── test_object_manipulation.py
│ ├── test_objectstreams.py
│ ├── test_optional_content.py
│ ├── test_page_links.py
│ ├── test_pagedelete.py
│ ├── test_pagelabels.py
│ ├── test_pixmap.py
│ ├── test_pylint.py
│ ├── test_release.py
│ ├── test_remove-rotation.py
│ ├── test_rewrite_images.py
│ ├── test_rtl.py
│ ├── test_showpdfpage.py
│ ├── test_spikes.py
│ ├── test_story.py
│ ├── test_tables.py
│ ├── test_tesseract.py
│ ├── test_textbox.py
│ ├── test_textextract.py
│ ├── test_textsearch.py
│ ├── test_threads.py
│ ├── test_toc.py
│ ├── test_typing.py
│ ├── test_widgets.py
│ ├── test_word_delimiters.py
│ └── util.py
└── valgrind.supp
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitattributes
================================================
*.pdf binary
================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.yml
================================================
name: Bug Report
description: Create a bug report for PyMuPDF
# We omit `title: "..."` so that the field defaults to blank. If we set it to
# empty string, Github seems to reject this .yml file.
body:
- type: textarea
id: description
attributes:
label: Description of the bug
description: |
A clear and concise description of the bug.
validations:
required: true
- type: textarea
id: reproduce
attributes:
label: How to reproduce the bug
# Should not word-wrap this description here.
description: |
* Explain the steps required to reproduce the bug.
* Include required code snippets, example files, etc.
* Describe what you expected to happen (if not obvious).
* If applicable, add screenshots to help explain the problem.
* Include any other information that could be relevant, for example information about the Python environment.
For problems when building or installing PyMuPDF:
* Give the **exact** build/install commands that were run.
* Give the **complete** output from these commands.
validations:
required: true
# - type: markdown
# attributes:
# value: |
# # The information below is required.
- type: dropdown
id: version
attributes:
label: PyMuPDF version
options:
- 1.27.2.3
- 1.27.2.2
- 1.27.2
- 1.27.1
- 1.27.0
- 1.26.x or earlier
- Built from source
description: |
* For example from `pymupdf.pymupdf_version`.
* We generally only look at bugs in the most recent release of PyMuPDF.
validations:
required: true
- type: dropdown
id: os_name
attributes:
label: Operating system
#multiple: true
options:
-
- Windows
- Linux
- MacOS
- OpenBSD
- Other
validations:
required: true
- type: dropdown
id: python_version
attributes:
label: Python version
#multiple: true
# Need quotes around `3.10` otherwise it is treated as a number and shows as `3.1`.
options:
-
- "3.14"
- "3.13"
- "3.12"
- "3.11"
- "3.10"
- "3.9"
validations:
required: true
================================================
FILE: .github/ISSUE_TEMPLATE/feature_request.md
================================================
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees:
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Potentially add an issue reference.
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
Are there several options for how your request could be met?
**Additional context**
Add any other context or screenshots about the feature request here.
================================================
FILE: .github/workflows/build_wheels.yml
================================================
name: Build wheels
on:
workflow_dispatch:
inputs:
flavours:
description: 'If set, we build separate PyMuPDF and PyMuPDFb wheels.'
type: boolean
default: false
sdist:
type: boolean
default: true
wheels_linux_aarch64:
type: boolean
default: true
wheels_linux_auto:
type: boolean
default: true
wheels_linux_pyodide:
type: boolean
default: false
wheels_windows_auto:
type: boolean
default: true
wheels_macos_auto:
type: boolean
default: true
wheels_cps:
description: 'wheels_cps: sets $CIBW_BUILD, E.g. "cp310* cp311*".'
type: string
PYMUPDF_SETUP_MUPDF_BUILD:
description: 'Value for PYMUPDF_SETUP_MUPDF_BUILD, e.g.: git:--branch master https://github.com/ArtifexSoftware/mupdf.git'
type: string
default: '-'
#PYMUPDF_SETUP_MUPDF_BUILD_TYPE:
# description: 'Value for PYMUPDF_SETUP_MUPDF_BUILD, e.g. debug.'
# type: string
# default: '-'
# We can't currently have more than 10 inputs
PYMUPDF_SETUP_PY_LIMITED_API:
description: 'If not "0", we build a single wheel for each platform.'
type: string
default: ''
jobs:
build_sdist:
if: ${{ inputs.sdist }}
name: Build sdist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build sdist
env:
inputs_wheels_default: 0
inputs_sdist: 1
inputs_flavours: ${{inputs.flavours}}
inputs_PYMUPDF_SETUP_MUPDF_BUILD: ${{inputs.PYMUPDF_SETUP_MUPDF_BUILD}}
run:
python scripts/gh_release.py
- uses: actions/upload-artifact@v4
with:
name: sdist-${{ matrix.os }}
path: dist/*.tar.gz
build_wheels:
#if: ${{ inputs.wheels }}
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# 2024-05-08: Need to specify macos-15-intel/14 to get x86_64/arm64.
os: [ubuntu-latest, windows-2019, macos-15-intel, macos-14]
# Avoid cancelling of all cibuildwheel runs after a single failure.
fail-fast: false
steps:
- uses: actions/checkout@v4
# Get Python 3.12 x32 and x64 on Windows. (As of 2023-10-12 these are not
# always available by default.)
#
- name: Install Python 3.12 x32 on Windows.
if: runner.os == 'Windows'
uses: actions/setup-python@v5
with:
python-version: '3.12'
architecture: x86
- name: Install Python 3.12 x64 on Windows.
if: runner.os == 'Windows'
uses: actions/setup-python@v5
with:
python-version: '3.12'
# Get Python for running cibuildwheel. This also ensures that 'python'
# works on MacOS, where it seems only 'python3' is available by default.
#
# Note that it seem to be important on MacOS not to specify a
# Python version here with `python-version: '3.12'` - this makes
# `python-config3` return settings for Python-3.12, instead of for
# whatever Python is being used by cibuildwheel.
#
- uses: actions/setup-python@v5
# On Linux, get qemu so we can build for aarch64.
#
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v1
with:
platforms: all
- name: gh_release
# Doesn't seem to be a way to passing inputs.* on command
# line, so we set environment instead. E.g. see:
# https://github.com/orgs/community/discussions/27088
#
env:
inputs_flavours: ${{inputs.flavours}}
inputs_sdist: ${{inputs.sdist}}
inputs_wheels_linux_aarch64: ${{inputs.wheels_linux_aarch64}}
inputs_wheels_linux_auto: ${{inputs.wheels_linux_auto}}
inputs_wheels_linux_pyodide: ${{inputs.wheels_linux_pyodide}}
#inputs_wheels_macos_arm64: ${{inputs.wheels_macos_arm64}}
inputs_wheels_macos_auto: ${{inputs.wheels_macos_auto}}
inputs_wheels_windows_auto: ${{inputs.wheels_windows_auto}}
inputs_PYMUPDF_SETUP_MUPDF_BUILD: ${{inputs.PYMUPDF_SETUP_MUPDF_BUILD}}
#inputs_PYMUPDF_SETUP_MUPDF_BUILD_TYPE: ${{inputs.PYMUPDF_SETUP_MUPDF_BUILD_TYPE}}
inputs_wheels_cps: ${{inputs.wheels_cps}}
PYMUPDF_SETUP_PY_LIMITED_API: ${{inputs.PYMUPDF_SETUP_PY_LIMITED_API}}
run:
python scripts/gh_release.py
# Upload generated wheels, to be accessible from github Actions page.
#
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}
path: ./wheelhouse/*.whl
================================================
FILE: .github/workflows/cla.yml
================================================
name: "CLA Assistant"
on:
pull_request_target:
types: [opened,closed,synchronize]
jobs:
CLAAssistant:
runs-on: ubuntu-latest
steps:
- name: "CLA Assistant"
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
# Beta Release
uses: contributor-assistant/github-action@v2.4.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# the below token should have repo scope and must be manually added by you in the repository's secret
PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
with:
path-to-signatures: 'signatures/version1/cla.json'
path-to-document: 'https://artifex.com/documents/Artifex%20Contributor%20License%20Agreement.pdf'
# branch should not be protected
branch: 'CLA'
allowlist:
# the following are the optional inputs - If the optional inputs are not given, then default values will be taken
#remote-organization-name: enter the remote organization name where the signatures should be stored (Default is storing the signatures in the same repository)
#remote-repository-name: enter the remote repository name where the signatures should be stored (Default is storing the signatures in the same repository)
#create-file-commit-message: 'For example: Creating file for storing CLA Signatures'
#signed-commit-message: 'For example: $contributorName has signed the CLA in #$pullRequestNo'
#custom-notsigned-prcomment: 'pull request comment with Introductory message to ask new contributors to sign'
#custom-pr-sign-comment: 'The signature to be committed in order to sign the CLA'
#custom-allsigned-prcomment: 'pull request comment when all contributors has signed, defaults to **CLA Assistant Lite bot** All Contributors have signed the CLA.'
#lock-pullrequest-aftermerge: false - if you don't want this bot to automatically lock the pull request after merging (default - true)
#use-dco-flag: true - If you are using DCO instead of CLA
================================================
FILE: .github/workflows/test-valgrind.yml
================================================
name: Test valgrind
on:
workflow_dispatch:
schedule:
- cron: '13 6 * * *'
jobs:
valgrind:
name: valgrind
runs-on: ubuntu-latest
strategy:
matrix:
args: [
'',
'-m "git:--branch master https://github.com/ArtifexSoftware/mupdf"',
'-m "git:--branch 1.27.x https://github.com/ArtifexSoftware/mupdf"',
]
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: valgrind
run:
python scripts/test.py ${{matrix.args}} -P 1 -T valgrind build test
================================================
FILE: .github/workflows/test.yml
================================================
# Run scripts/test.py directly on multiple Github servers. Instead of
# specifying individual inputs, we support a single string input which is used
# for the command line directly.
#
# This ensures we behave exactly like scripts/test.py, without confusion caused
# by having to translate between differing APIs.
name: Tests
on:
#schedule:
# - cron: '47 4 * * *'
#pull_request:
# branches: [main]
workflow_dispatch:
inputs:
args:
type: string
default: ''
description: 'Arguments to pass to scripts/test.py'
jobs:
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-2022, macos-15-intel, macos-14]
# Avoid cancelling of all runs after a single failure.
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
# https://github.com/pypa/cibuildwheel/issues/2114
# https://cibuildwheel.pypa.io/en/stable/faq/#emulation
#
- name: Set up QEMU
if: runner.os == 'Linux' && runner.arch == 'X64'
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: test
env:
PYMUPDF_test_args: ${{inputs.args}}
run:
python scripts/test.py -a PYMUPDF_test_args
# Upload generated wheels, to be accessible from github Actions page.
#
- uses: actions/upload-artifact@v4
with:
path: |
wheelhouse/pymupdf*.whl
wheelhouse/pymupdf*.tar.gz
name: artifact-${{ matrix.os }}
================================================
FILE: .github/workflows/test_multiple.yml
================================================
# Run scripts/test.py on multiple OS's (Windows, Linux, MacOS x64, MacOS arm64)
# and with multiple specifications of MuPDF (PyMuPDF's hard-coded default,
# master branch, release branch).
name: multiple
on:
workflow_dispatch:
inputs:
args:
type: string
default: ''
description: 'Additional arguments to scripts/test.py'
schedule:
- cron: '13 6 * * *'
jobs:
multiple:
name: multiple
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-2022, macos-15-intel, macos-14]
args: [
'',
'-m "git:--branch master https://github.com/ArtifexSoftware/mupdf"',
'-m "git:--branch 1.27.x https://github.com/ArtifexSoftware/mupdf"',
]
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: multiple
env:
PYMUPDF_test_args: ${{inputs.args}}
run:
python scripts/test.py ${{matrix.args}} wheel test -a PYMUPDF_test_args
================================================
FILE: .github/workflows/test_pyodide.yml
================================================
name: Test pyodide
# Build and test pyodide wheels using cibuildwheel.
on:
workflow_dispatch:
schedule:
- cron: '13 5 * * *'
jobs:
pyodide:
name: pyodide
runs-on: ubuntu-latest
strategy:
matrix:
# 2025-09-05: We don't test with default mupdf because mupdf-1.26.7
# does not have the required pyodide rpath changes.
args: [
# '',
'-m "git:--branch master https://github.com/ArtifexSoftware/mupdf"',
'-m "git:--branch 1.27.x https://github.com/ArtifexSoftware/mupdf"',
]
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.12
- name: pyodide
run:
python scripts/test.py ${{matrix.args}} --cibw-pyodide 1 cibw
# We do not use upload-artifact@v4 because it fails due to us creating
# identically-named wheels.
#- uses: actions/upload-artifact@v4
# with:
# path: ./wheelhouse/*.whl
================================================
FILE: .github/workflows/test_quick.yml
================================================
name: test_quick
on:
pull_request:
branches: [main]
workflow_dispatch:
inputs:
args:
type: string
default: ''
description: 'Additional arguments to scripts/test.py'
jobs:
master:
name: mupdf master
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: mupdf master
env:
PYMUPDF_test_args: ${{inputs.args}}
run:
python scripts/test.py build test -m 'git:--branch master https://github.com/ArtifexSoftware/mupdf.git' -a PYMUPDF_test_args
release:
name: mupdf release
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: mupdf release
env:
PYMUPDF_test_args: ${{inputs.args}}
run:
python scripts/test.py build test -m 'git:--branch 1.27.x https://github.com/ArtifexSoftware/mupdf.git' -a PYMUPDF_test_args
================================================
FILE: .github/workflows/test_sysinstall.yml
================================================
name: Test sysinstall
on:
schedule:
- cron: '13 4 * * *'
workflow_dispatch:
inputs:
args:
description: 'Extra args for scripts/sysinstall.py.'
jobs:
sysinstall:
name: Test sysinstall
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
# It seems to be important not to install a custom python here,
# because `sudo` (which we need to use when installing to /usr/local
# etc) always ends up running the default python, even if we set
# $PATH etc. So for example we can end up with mupdf files and
# pymupdf files being installed into .../python3.11/site-packages and
# .../python3.10/site-packages, and tests all fail to import pymupdf.
#
#- uses: actions/setup-python@v5
#with:
# # 3.12 doesn't have setuptools. As of 2024-01-03, MuPDF build requires setuptools before it
# # sees `--venv` and defers to a venv, so we currently have to force use of python 3.11.
# python-version: '3.11'
- name: sysinstall_venv
env:
PYMUDF_SCRIPTS_SYSINSTALL_ARGS_POST: ${{inputs.args}}
run:
# Use venv.
python3 scripts/sysinstall.py --mupdf-git '--branch master https://github.com/ArtifexSoftware/mupdf.git'
- name: sysinstall_sudo
env:
PYMUDF_SCRIPTS_SYSINSTALL_ARGS_POST: ${{inputs.args}}
run:
# Do not use a venv, instead install required packages with sudo.
python3 scripts/sysinstall.py --mupdf-git '--branch master https://github.com/ArtifexSoftware/mupdf.git' --pip sudo --root /
================================================
FILE: .gitignore
================================================
*.pyc
*.so
*.o
*.swp
build/
demo/README.rst
docs/build
docs/_build
================================================
FILE: .python-version
================================================
3.12
================================================
FILE: .readthedocs.yaml
================================================
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
version: 2
# Set the version of Python and other tools you might need
build:
os: ubuntu-20.04
tools:
python: "3.13" # let's use the default Python version provided by Read the Docs
# You can also specify other tool versions:
# nodejs: "16"
# rust: "1.55"
# golang: "1.17"
# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py
# If using Sphinx, optionally build your docs in additional formats such as PDF
formats: all
# Optionally declare the Python requirements required to build your docs
python:
install:
- requirements: docs/requirements.txt
================================================
FILE: .vs/ProjectSettings.json
================================================
{
"CurrentProjectSetting": ""
}
================================================
FILE: .vs/VSWorkspaceState.json
================================================
{
"ExpandedNodes": [
""
],
"SelectedNode": "",
"PreviewInSolutionExplorer": false
}
================================================
FILE: COPYING
================================================
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
.
================================================
FILE: README.md
================================================
# PyMuPDF
[](https://pymupdf.readthedocs.io)
[](https://pypi.org/project/PyMuPDF/)
[](https://pypi.org/project/pymupdf/)
[](https://github.com/pymupdf/PyMuPDF/blob/master/COPYING)
[](https://pepy.tech/projects/pymupdf)
[](https://github.com/pymupdf/PyMuPDF/stargazers)
[](https://pymupdf.io/discord/artifex/)
[](https://forum.mupdf.com/c/general/4)
[](https://x.com/pymupdf4llm)
[](https://huggingface.co/artifex-software)
[](https://demo.pymupdf.io)
**The PDF engine behind over 50 million monthly downloads, powering AI pipelines worldwide.**
**PyMuPDF is a high-performance Python library for data extraction, analysis, conversion, rendering and manipulation of PDF (and other) documents.** Built on top of MuPDF — a lightweight, fast C engine — PyMuPDF gives you precise, low-level control over documents alongside high-level convenience APIs. No mandatory external dependencies.
[](https://github.com/pymupdf/PyMuPDF/)
---
## Why PyMuPDF?
- **Fast** — powered by [MuPDF](https://mupdf.com/), a best-in-class C rendering engine
- **Accurate** — pixel-perfect text extraction with font, color, and position metadata
- **Versatile** — read, write, annotate, redact, merge, split, and convert documents
- **LLM-ready** — native Markdown output via [PyMuPDF4LLM](https://pypi.org/project/pymupdf4llm/) for RAG and AI pipelines
- **No mandatory dependencies** — `pip install pymupdf` and you're done
---
## Installation
```bash
pip install pymupdf
```
Wheels are available for **Windows**, **macOS**, and **Linux** on Python 3.10–3.14. If no pre-built wheel exists for your platform, pip will compile from source (requires a C/C++ toolchain).
### Optional extras
| Package | Purpose |
|---|---|
| `pymupdf-fonts` | Extended font collection for text output |
| `pymupdf4llm` | LLM/RAG-optimised Markdown and JSON extraction |
| `pymupdfpro` | Adds Office document support |
| `tesseract-ocr` | OCR for scanned pages and images (separate install) |
```bash
# More fonts
pip install pymupdf-fonts
# LLM-ready extraction
pip install pymupdf4llm
# Office support
pip install pymupdfpro
# OCR (Tesseract must be installed separately)
# macOS
brew install tesseract
# Ubuntu / Debian
sudo apt install tesseract-ocr
```
---
## Supported File Formats
### Input
| Category | Formats |
|---|---|
| PDF & derivatives | PDF, XPS, EPUB, CBZ, MOBI, FB2, SVG, TXT |
| Images | PNG, JPEG, BMP, TIFF, GIF, and more |
| Microsoft Office *(Pro)* | DOC, DOCX, XLS, XLSX, PPT, PPTX |
| Korean Office *(Pro)* | HWP, HWPX |
### Output
| Format | Notes |
|---|---|
| PDF | Full fidelity conversion from Office formats |
| SVG | Vector page rendering |
| Image (PNG, JPEG, …) | Page rasterisation at any DPI |
| Markdown | Structure-aware, LLM-ready |
| JSON | Bounding boxes, layout data, per-element detail |
| Plain text | Fast, lightweight extraction |
---
## Quick start
### Extract text
```python
import pymupdf
doc = pymupdf.open("document.pdf")
for page in doc:
print(page.get_text())
```
### Extract text with layout metadata
```python
import pymupdf
doc = pymupdf.open("document.pdf")
page = doc[0]
blocks = page.get_text("dict")["blocks"]
for block in blocks:
if block["type"] == 0: # text block
for line in block["lines"]:
for span in line["spans"]:
print(f"{span['text']!r} font={span['font']} size={span['size']:.1f}")
```
### Extract tables
```python
import pymupdf
doc = pymupdf.open("spreadsheet.pdf")
page = doc[0]
tables = page.find_tables()
for table in tables:
print(table.to_markdown())
# or get as Pandas DataFrame
df = table.to_pandas()
```
### Render a page to an image
```python
import pymupdf
doc = pymupdf.open("document.pdf")
page = doc[0]
pixmap = page.get_pixmap(dpi=150)
pixmap.save("page_0.png")
```
### OCR a scanned document
```python
import pymupdf
doc = pymupdf.open("scanned.pdf")
page = doc[0]
# Requires Tesseract installed and on PATH
text = page.get_textpage_ocr(language="eng").extractText()
print(text)
```
### Convert to Markdown for LLMs
```python
import pymupdf4llm
md = pymupdf4llm.to_markdown("report.pdf")
# Pass directly to your LLM or vector store
print(md)
```
### Annotate and redact
```python
import pymupdf
doc = pymupdf.open("contract.pdf")
page = doc[0]
# Add a highlight annotation
rect = pymupdf.Rect(72, 100, 400, 120)
page.add_highlight_annot(rect)
# Add a redaction and apply it
page.add_redact_annot(rect)
page.apply_redactions()
doc.save("contract_redacted.pdf")
```
### Merge PDFs
```python
import pymupdf
merger = pymupdf.open()
for path in ["part1.pdf", "part2.pdf", "part3.pdf"]:
merger.insert_pdf(pymupdf.open(path))
merger.save("merged.pdf")
```
### Convert an Office document to PDF
```python
import pymupdf.pro
pymupdf.pro.unlock("YOUR-LICENSE-KEY")
doc = pymupdf.open("presentation.pptx")
pdf_bytes = doc.convert_to_pdf()
with open("output.pdf", "wb") as f:
f.write(pdf_bytes)
```
### Extract LLM-ready Markdown from a Word document
```python
import pymupdf4llm
import pymupdf.pro
pymupdf.pro.unlock("YOUR-LICENSE-KEY")
md = pymupdf4llm.to_markdown("document.docx")
print(md)
```
---
## Features
### Core capabilities
| Feature | Description |
|---|---|
| **Text extraction** | Plain text, rich dict (font, size, color, bbox), HTML, XML, raw blocks |
| **Table detection** | `find_tables()` — locate, extract, and export tables as Markdown or structured data |
| **Image extraction** | Extract embedded images and render any page to a high-resolution `Pixmap` |
| **Rendering** | Render PDF pages to images or `Pixmap` data for use in UI or other workflows |
| **OCR** | Tesseract integration — full-page or partial OCR, configurable language |
| **Annotations** | Read and write highlights, underlines, squiggly lines, sticky notes, free text, ink, stamps |
| **Redaction** | Add and permanently apply redaction annotations |
| **Forms** | Read and fill PDF AcroForm fields |
| **PDF editing** | Insert, delete, and reorder pages; set metadata; merge and split documents |
| **Drawing** | Draw lines, curves, rectangles, and circles; insert HTML boxes |
| **Encryption** | Open password-protected PDFs; save with RC4 or AES encryption |
| **Links** | Extract hyperlinks, internal cross-references, and URI targets |
| **Bookmarks** | Read and write the outline / table of contents tree |
| **Metadata** | Title, author, creation date, producer, subject, and custom entries |
| **Color spaces** | RGB, CMYK, greyscale; color space conversion |
### LLM & AI output (via PyMuPDF4LLM)
| Output | API |
|---|---|
| Markdown | `pymupdf4llm.to_markdown(path)` |
| JSON | `pymupdf4llm.to_json(path)` |
| Plain text | `pymupdf4llm.to_text(path)` |
Supports multi-column layouts, natural reading order and page chunking.
[](https://demo.pymupdf.io)
---
## Supported Python versions
Python **3.10 – 3.14** (as of v1.27.x). Wheels ship for:
- `manylinux` x86\_64 and aarch64
- `musllinux` x86\_64
- macOS x86\_64 and arm64
- Windows x86 and x86\_64
---
## Performance
PyMuPDF is built on MuPDF — one of the fastest PDF rendering engines available. Typical benchmarks against pure-Python PDF libraries show **10–50× speed improvements** for text extraction and **100× or more** for page rendering, with a minimal memory footprint.
For AI workloads, PyMuPDF4LLM processes documents **without a GPU**, cutting infrastructure costs significantly compared to vision-based LLM approaches.
---
## Recipes
Extract all images from a PDF
```python
import pymupdf
from pathlib import Path
doc = pymupdf.open("document.pdf")
out = Path("images")
out.mkdir(exist_ok=True)
for page_index, page in enumerate(doc):
for img_index, img in enumerate(page.get_images()):
xref = img[0]
pix = pymupdf.Pixmap(doc, xref)
if pix.n > 4: # convert CMYK
pix = pymupdf.Pixmap(pymupdf.csRGB, pix)
pix.save(out / f"page{page_index}_img{img_index}.png")
```
Search for text across a document
```python
import pymupdf
doc = pymupdf.open("document.pdf")
needle = "confidential"
for page in doc:
hits = page.search_for(needle)
if hits:
print(f"Page {page.number}: {len(hits)} occurrence(s)")
for rect in hits:
page.add_highlight_annot(rect)
doc.save("highlighted.pdf")
```
Split a PDF into individual pages
```python
import pymupdf
doc = pymupdf.open("document.pdf")
for i, page in enumerate(doc):
out = pymupdf.open()
out.insert_pdf(doc, from_page=i, to_page=i)
out.save(f"page_{i + 1}.pdf")
```
Insert a watermark on every page
```python
import pymupdf
doc = pymupdf.open("document.pdf")
for page in doc:
page.insert_text(
point=pymupdf.Point(72, page.rect.height / 2),
text="DRAFT",
fontsize=72,
color=(0.8, 0.8, 0.8),
rotate=45,
)
doc.save("watermarked.pdf")
```
---
## Office Document Processing
PyMuPDF can be extended with PyMuPDF Pro. This adds a conversion layer that handles Microsoft and Korean Office formats natively — no Office installation, no COM interop, no LibreOffice subprocess.
Once unlocked, `pymupdf.open()` accepts Office files exactly like PDFs:
```python
import pymupdf.pro
pymupdf.pro.unlock("YOUR-LICENSE-KEY")
# Works identically regardless of format
for fmt in ["contract.docx", "data.xlsx", "deck.pptx", "report.hwpx"]:
doc = pymupdf.open(fmt)
for page in doc:
print(page.get_text())
```
[Get a trial license key for PyMuPDF Pro](https://pymupdf.pro/try-pro)
**What you can do with Office documents:**
- Extract text and images page-by-page
- Convert to PDF with `doc.convert_to_pdf()`
- Rasterise pages to PNG/JPEG for visual inspection
- Feed directly into PyMuPDF4LLM for AI-ready output
### Restrictions Without a License Key
When `pymupdf.pro.unlock()` is called **without** a key, the following restrictions apply:
| Restriction | Detail |
|---|---|
| Page limit | Only the **first 3 pages** of any document are accessible |
| Time limit | Evaluation period — functionality expires after a set duration |
All other Pro features work normally within these constraints, making it straightforward to prototype before purchasing a license.
---
## Frequently Asked Questions
### Can I use PyMuPDF, PyMuPDF4LLM and PyMuPDF Pro without sending data to the cloud?
Yes, absolutely — and this is one of PyMuPDF's most significant advantages.
PyMuPDF runs entirely locally. It is a native Python library built on top of the MuPDF C engine. When you call `pymupdf.open()`, `page.get_text()`, `page.find_tables()`, or any other method, everything executes in-process on your own machine. No data is transmitted anywhere.
There are no telemetry calls, no licence validation callbacks, no cloud dependencies of any kind in the open-source AGPL build or the commercial build. Once the package is installed, it works fully air-gapped.
This makes PyMuPDF well-suited for:
- Regulated industries — healthcare (HIPAA), finance, legal, government, where documents cannot leave a controlled environment
- On-premise deployments — servers with no outbound internet access
- Air-gapped systems — classified or sensitive environments
- Self-hosted RAG pipelines — processing confidential documents locally before feeding an on-premise LLM
- Saving on token costs for document pre-processing before sending data to your LLM
The only thing you need an internet connection for is the initial `pip install`. After that, the package and all its capabilities are entirely self-contained.
### Should I `import pymupdf` or `import fitz`?
Use `import pymupdf`. The `fitz` name is a legacy alias that still works as of v1.24.0+, but `import pymupdf` is the recommended and future-proof approach. The two are interchangeable in existing code:
```python
import pymupdf # recommended
# import fitz # legacy alias — still works but avoid for new code
```
### Does PyMuPDF work with Korean, Japanese, or Chinese documents?
Yes — PyMuPDF has solid CJK support
### How do I extract Markdown from PDF for LLM?
Let PyMuPDF4LLM do everything (recommended for RAG).
PyMuPDF4LLM is a high-level wrapper that outputs standard text and table content together in an integrated Markdown-formatted string across all document pages PyMuPDF — tables are detected, converted to GitHub-compatible Markdown, and interleaved with surrounding text in the correct reading order. This is the best starting point for feeding an LLM or building a RAG pipeline.
```python
import pymupdf4llm
md = pymupdf4llm.to_markdown("report.pdf")
print(md)
# Tables appear as Markdown | col1 | col2 | ... inline with the text
```
### Text extraction returns garbled characters or empty output. Why?
This usually means the PDF uses custom font encodings without a proper character map (CMAP). The font's glyphs are present but cannot be mapped back to Unicode. In these cases:
- Use OCR as a fallback (`page.get_textpage_ocr()`)
- Consider that scanned PDFs will always need OCR — text extraction on scans returns nothing
### How do I extract text from a specific area of a page?
Pass a `clip` rectangle to `get_text()`:
```python
import pymupdf
doc = pymupdf.open("input.pdf")
page = doc[0]
# Define the area you want (x0, y0, x1, y1) in points
clip = pymupdf.Rect(50, 100, 400, 300)
text = page.get_text("text", clip=clip)
```
### How do I search for text and find its location on the page?
```python
import pymupdf
doc = pymupdf.open("input.pdf")
page = doc[0]
# Returns a list of Rect objects surrounding each match
locations = page.search_for("invoice number")
for rect in locations:
print(rect) # e.g. Rect(72.0, 120.5, 210.0, 134.0)
```
### `get_images` shows no images but I can clearly see charts in the PDF. Why?
Charts and diagrams created by tools like matplotlib, Excel, or R are typically rendered as vector graphics (PDF drawing commands), not raster images. `get_images` only lists embedded raster image objects and will not detect vector graphics. To capture these, rasterise the entire page with `page.get_pixmap()`.
### How does OCR work in PyMuPDF? Does it require a separate Tesseract installation?
PyMuPDF uses MuPDF's built-in Tesseract-based OCR support, so there is no Python-level `pytesseract` dependency. However, PyMuPDF still needs access to the **Tesseract language data files** (`tessdata`), and automatic tessdata discovery may invoke the `tesseract` executable (for example, to list available languages) if you do not explicitly provide a tessdata path. In practice, the recommended setup is to either install Tesseract so discovery works automatically, or configure the tessdata location yourself via the `tessdata` parameter or the `TESSDATA_PREFIX` environment variable. Over 100 languages are supported.
```python
import pymupdf
doc = pymupdf.open("scanned.pdf")
page = doc[0]
# Get a text page using OCR
tp = page.get_textpage_ocr(language="eng")
text = page.get_text(textpage=tp)
print(text)
```
### How do I run OCR on a standalone image file (not a PDF)?
```python
import pymupdf
pix = pymupdf.Pixmap("image.png")
if pix.alpha:
pix = pymupdf.Pixmap(pix, 0) # remove alpha channel — required for OCR
# Wrap in a 1-page PDF and OCR it
doc = pymupdf.open()
page = doc.new_page(width=pix.width, height=pix.height)
page.insert_image(page.rect, pixmap=pix)
tp = page.get_textpage_ocr()
text = page.get_text(textpage=tp)
```
### How do I highlight text in a PDF?
```python
import pymupdf
doc = pymupdf.open("input.pdf")
page = doc[0]
# Use quads=True for accurate highlights on non-horizontal text
quads = page.search_for("important term", quads=True)
page.add_highlight_annot(quads)
doc.save("highlighted.pdf")
```
PyMuPDF supports all standard PDF text markers: highlight, underline, strikeout, and squiggly.
### How do I permanently redact (remove) content from a PDF?
Redaction is a deliberate two-step process so you can review before committing:
```python
import pymupdf
doc = pymupdf.open("input.pdf")
page = doc[0]
# Step 1: Mark the area(s) to redact
rect = page.search_for("confidential")[0]
page.add_redact_annot(rect, fill=(1, 1, 1)) # white fill
# Step 2: Apply — permanently removes the underlying content
page.apply_redactions()
doc.save("redacted.pdf")
```
After `apply_redactions()`, the original content is gone. It cannot be recovered from the saved file.
### How do I read form field values from a PDF?
```python
import pymupdf
doc = pymupdf.open("form.pdf")
page = doc[0]
for field in page.widgets():
print(f"{field.field_name}: {field.field_value}")
```
### How do I fill in a PDF form programmatically?
```python
import pymupdf
doc = pymupdf.open("form.pdf")
page = doc[0]
for field in page.widgets():
if field.field_name == "First Name":
field.field_value = "Ada"
field.update()
doc.save("filled_form.pdf")
```
### Can I use multithreading with PyMuPDF?
No. PyMuPDF does not support multithreaded use, even with Python's newer free-threading mode. The underlying MuPDF library only provides partial thread safety, and a fully thread-safe PyMuPDF implementation would still impose a single-threaded overhead — negating the benefit.
**Use multiprocessing instead.** Each process opens the file independently and works on its own page range:
```python
from multiprocessing import Pool
import pymupdf
def process_pages(args):
path, start, end = args
doc = pymupdf.open(path) # each process opens its own handle
results = []
for i in range(start, end):
results.append(doc[i].get_text())
return results
with Pool(4) as pool:
chunks = [("input.pdf", 0, 25), ("input.pdf", 25, 50), ...]
all_results = pool.map(process_pages, chunks)
```
### How can I speed up repeated text extraction on the same page?
Reuse a `TextPage` object. Creating a `TextPage` is the expensive part — once created, switching between extraction formats is cheap:
```python
import pymupdf
page = doc[0]
tp = page.get_textpage() # create once
text = page.get_text("text", textpage=tp)
words = page.get_text("words", textpage=tp)
data = page.get_text("dict", textpage=tp)
```
This can reduce execution time by 50–95% for repeated extractions on the same page.
### How do I read and write PDF metadata?
```python
import pymupdf
doc = pymupdf.open("input.pdf")
# Read
print(doc.metadata)
# {'title': '...', 'author': '...', 'subject': '...', 'keywords': '...', ...}
# Write
doc.set_metadata({
"title": "Annual Report 2025",
"author": "Finance Team",
"keywords": "annual, finance, 2025"
})
doc.save("output.pdf")
```
### How do I read or set the table of contents / bookmarks?
```python
import pymupdf
doc = pymupdf.open("input.pdf")
# Read — returns a list of [level, title, page_number] entries
toc = doc.get_toc()
for level, title, page in toc:
print(" " * level, title, "→ page", page)
# Write
new_toc = [
[1, "Introduction", 1],
[1, "Methods", 5],
[2, "Data sources", 6],
]
doc.set_toc(new_toc)
doc.save("output.pdf")
```
---
## Documentation
Full installation guide, API reference, cookbook, and tutorial at **[pymupdf.readthedocs.io](https://pymupdf.readthedocs.io)**.
- [Installation guide](https://pymupdf.readthedocs.io/en/latest/installation.html)
- [API reference](https://pymupdf.readthedocs.io/en/latest/classes.html)
- [Cookbook](https://pymupdf.readthedocs.io/en/latest/the-basics.html)
- [Tutorial](https://pymupdf.readthedocs.io/en/latest/tutorial.html)
- [Changelog](https://pymupdf.readthedocs.io/en/latest/changes.html)
- [PyMuPDF4LLM docs](https://pymupdf.readthedocs.io/en/latest/pymupdf4llm/)
- [PyMuPDF Pro docs](https://pymupdf.readthedocs.io/en/latest/pymupdf-pro/index.html)
---
## Related projects
| Project | Description |
|---|---|
| [PyMuPDF4LLM](https://github.com/pymupdf/pymupdf4llm) | LLM/RAG-optimised Markdown and JSON extraction |
| [PyMuPDF Pro](https://pymupdf.io/pro) | Adds Office and HWP document support |
| [pymupdf-fonts](https://pypi.org/project/pymupdf-fonts/) | Extended font collection for PyMuPDF text output |
---
## Licensing
PyMuPDF and MuPDF are maintained by [Artifex Software, Inc.](https://artifex.com)
- **Open source** — [GNU AGPL v3](https://www.gnu.org/licenses/agpl-3.0.html). Free for open-source projects.
- **Commercial** — separate commercial licences available from [Artifex](https://artifex.com/licensing) for proprietary applications.
---
## Contributing
Contributions are welcome. Please open an issue before submitting large pull requests.
- [Issue tracker](https://github.com/pymupdf/PyMuPDF/issues)
- [Discord community](https://pymupdf.pro/discord/artifex/)
## ⭐ Support this project
If you find this useful, please consider giving it a star — it helps others discover it!
[](https://github.com/pymupdf/PyMuPDF/)
================================================
FILE: READMEb.md
================================================
# PyMuPDFb
This wheel contains [MuPDF](https://mupdf.readthedocs.io/) shared libraries for
use by [PyMuPDF](https://pymupdf.readthedocs.io/).
This wheel is shared by PyMuPDF wheels that are specific to different Python
versions, significantly reducing the total size of a release.
================================================
FILE: READMEd.md
================================================
# PyMuPDFd
This wheel contains [MuPDF](https://mupdf.readthedocs.io/) build-time files
that were used to build [PyMuPDF](https://pymupdf.readthedocs.io/).
================================================
FILE: changes.txt
================================================
Change Log
==========
**Changes in version 1.27.2.3** (2026-04-24)
* Fixed issues:
* **Fixed** `4928 `_: pymupdf.Document.scrub raises AttributeError for a document with annotations
* **Fixed** `4942 `_: bug: IndexError for Page.get_links after Page.clip_to_rect
* **Fixed** `4954 `_: get_drawings() returns incorrect lineJoin and width
* **Fixed** `4958 `_: bug: inserting rotated pages to another document messes up link coordinates
* Other:
* Fixed incorrect generation of `lineJoin j` in PDF content, introduced in 1.27.2.2.
* Allow build to (incorrectly) claim to be thread-safe, for #4760. See setup.py for details.
* Use pypi.org's pipcl package instead of our own pipcl.py file.
**Changes in version 1.27.2.2** (2026-03-20)
* Fixed issues:
* **Fixed** `4902 `_: Incorrect linewidth in elements returned by Page.get_texttrace()
* **Fixed** `4932 `_: "Page" has no attribute "find_tables" in PyMuPDF 1.27
* Other:
* Added `Annot.__bool__()`.
**Changes in version 1.27.2.** (2026-03-10)
* Use MuPDF-1.27.2.
* Fixed issues:
* **Fixed** `4903 `_: Typing broken because of `*_forward_decl`
* Other:
* Retrospectively marked #4907 as fixed in pymupdf-1.27.1.
* Improved `get_textpage_ocr()`.
For partial OCR, **all** page areas outside legible text are now OCRed, not
just those within images. This means that OCR will now also be performed
for vector graphics, and for text containing illegible characters.
* Provide a Linux wheel for free-threading python,
specifically cp314-cp314t-manylinux_2_28_x86_64.
**Changes in version 1.27.1** (2026-02-11)
* Use MuPDF-1.27.1.
* Fixed issues:
* **Fixed** `4599 `_: page.cluster_drawings extract a lot of small clusters once upgraded to 1.26
* **Fixed** `4751 `_: Memory leaking in page.widgets()
* **Fixed** `4762 `_: Importing pymupdf make pillow segmentation fault for converting jp2 file on ArchLinux
* **Fixed** `4790 `_: Problem to delete pages on PDF
* **Fixed** `4857 `_: Package is missing py.typed file required for type checking
* **Fixed** `4886 `_:
width attribute behaviour seems wrong
* **Fixed** `4907 `_: signal 11:SIGSEGV while using display_list.get_textpage()
* Other:
* Added `pymupdf.TEXT_CLIP`.
* Removed support for mupdf < 1.26.
* New arg `raise_on_repair` in `Document.save()`.
* New method `Document.repair()`.
**Changes in version 1.26.7** (2025-12-11)
* Use MuPDF-1.26.12.
* **Fixed** `4801 `_: Build failure dumping all environment variables
Other:
* Retrospectively mark `4756 `_ as fixed in 1.26.6.
* Improved safety of `pymupdf embed-extract`. This now refuses to write to
an existing file or outside current directory, unless `-output` or new flag
`-unsafe` is specified.
**Changes in version 1.26.6** (2025-11-05)
* Use MuPDF-1.26.11.
* Supported Python versions are now 3.10-3.14.
* Fixed issues:
* **Fixed** `4699 `_: cannot find ExtGState resource
* **Fixed** `4712 `_: Crash with "corrupted double-linked list"
* **Fixed** `4720 `_: Memory leaking in rewrite_images?
* **Fixed** `4742 `_: 'Rect' object has no attribute 'get_area'
* **Fixed** `4746 `_: Document.__init__() got an unexpected keyword argument 'encoding'
* **Fixed** `4756 `_: swig --version doesn't work in all versions of swig; -version should be used instead
**Changes in version 1.26.5** (2025-10-10)
* Use MuPDF-1.26.10.
* Fixed issues:
* **Fixed** `2883 `_: Improve the Python type annotations for fitz_new
* **Fixed** `4507 `_: Bugs in pyodide
* **Fixed** `4613 `_: Thai and number blocks are not auto-scaled and get wrong hyphen when using in insert_htmlbox
* **Fixed** `4700 `_: pymupdf.open() processes .zip file without raising
* **Fixed** `4716 `_: Problems with unreadable characters
* Other:
* Supported Python versions are now 3.9-3.14.
* We now define all class methods explicitly instead of with dynamic assignment; this improves type hints.
* Removed `pymupdf.utils.Shape` class, was duplicate of `pymupdf.Shape`.
* Allow use of cibuildwheel to build and test on Pyodide.
* Fixed various Pyodide bugs.
* In documentation, added section about Linux wheels and glibc compatibility.
* Improved documentation of pymupdf.open()'s arg.
* Retrospectively mark `4544 `_ as fixed in 1.26.4.
**Changes in version 1.26.4 (2025-08-25)**
* Use MuPDF-1.26.7.
* Fixed issues:
* **Fixed** `3806 `_: pdf to image rendering ignore optional content offs
* **Fixed** `4388 `_: Incorrect PixMap from page due to cached data from other PDF
* **Fixed** `4457 `_: Wrong characters displayed after font subsetting (w/ native method)
* **Fixed** `4462 `_: delete_pages() does not accept a single int
* **Fixed** `4533 `_: Open PDF error segmentation fault
* **Fixed** `4544 `_: About pdf_clip_page
* **Fixed** `4565 `_: MacOS uses Tesseract and not Tesseract-OCR
* **Fixed** `4571 `_: Broken merged pdfs.
* **Fixed** `4590 `_: TypeError in utils.py scrub(): annot.update_file(buffer=...) is invalid
* **Fixed** `4614 `_: Intercept bad widgets when inserting to another PDF
* **Fixed** `4639 `_: pymupdf.mupdf.FzErrorGeneric: code=1: Director error: : 'JM_new_bbox_device_Device' object has no attribute 'layer_name'
* Other:
* Check that #4392 `Segfault when running with pytest and -Werror` is fixed if PyMuPDF is built with swig>=4.4.
* Add `Page.clip_to_rect()`.
* Improved search for Tesseract data.
* Retrospectively mark #4496 as fixed in 1.26.1.
* Retrospectively mark #4503 as fixed in 1.26.3.
* Added experimental support for Graal.
**Changes in version 1.26.3 (2025-07-02)**
* Use MuPDF-1.26.3.
* Fixed issues:
* **Fixed** `4462 `_: delete_pages() does not accept a single int
* **Fixed** `4503 `_: Undetected character styles
* **Fixed** `4527 `_: Rect.intersects() is much slower than necessary
* **Fixed** `4564 `_: Possible encoding issue in PDF metadata
* **Fixed** `4575 `_: Bug with IRect contains method
* Other:
* Class Shape is now available as pymupdf.Shape.
* Added table cell markdown support.
**Changes in version 1.26.2**
[Skipped.]
**Changes in version 1.26.1 (2025-06-11)**
* Use MuPDF-1.26.2.
* Fixed issues:
* **Fixed** `4520 `_: show_pdf_page does not like empty pages created by new_page
* **Fixed** `4524 `_: fitz.get_text ignores 'pages' kwarg
* **Fixed** `4412 `_: Regression? Spurious error? in insert_pdf in v1.25.4
* **Fixed** `4496 `_: pymupdf4llm with pymupdfpro
* Other:
* Partial fix for `4503 `_: Undetected character styles
* New method `Document.rewrite_images()`, useful for reducing file size, changing image formats, or converting color spaces.
* `Page.get_text()`: restrict positional args to match docs.
* Removed bogus definition of class `Shape`.
* Removed release date from module, docs and changelog.
* `pymupdf.pymupdf_date` and `pymupdf.VersionDate` are now both None.
* They will be removed in a future release.
**Changes in version 1.26.0 (2025-05-22)**
* Use MuPDF-1.26.1.
* Fixed issues:
* **Fixed** `4324 `_: cluster_drawings() fails to cluster horizontal and vertical thin lines
* **Fixed** `4363 `_: Trouble with searching
* **Fixed** `4404 `_: IndexError in page.get_links()
* **Fixed** `4412 `_: Regression? Spurious error? in insert_pdf in v1.25.4
* **Fixed** `4423 `_: pymupdf.mupdf.FzErrorFormat: code=7: cannot find object in xref error encountered after version 1.25.3
* **Fixed** `4435 `_: get_pixmap method stuck on one page
* **Fixed** `4439 `_: New Xml class from data does not work - bug in code
* **Fixed** `4445 `_: Broken XREF table incorrectly repaired
* **Fixed** `4447 `_: Stroke color of annotations cannot be correctly set
* **Fixed** `4479 `_: set_layer_ui_config() toggles all layers rather than just one
* **Fixed** `4505 `_: Follow Widget flag values up its parent structure
* Other:
* Partial fixed for `4457 `_: Wrong characters displayed after font subsetting (w/ native method)
* Support image stamp annotations.
* Support recoloring pages.
* Added example of using Django's file storage API to open files with pymupdf.
* Clarified FreeText annotation color options.
We now raise an exception if an attempt is made to set attributes that can not be supported.
* Fixed potential segv in Pixmap.is_unicolor().
* Added runtime assert that that PyMuPDF and MuPDF were built with compatible
NDEBUG settings (related to `4390 `_).
* Simplified handling of filename/filetype when opening documents.
* Removed PDF linearization support.
* Calls to `Document.save()` with `linear` set to true will now raise an exception.
* See https://artifex.com/blog/mupdf-removes-linearisation for more information.
**Changes in version 1.25.5 (2025-03-31)**
* Fixed issues:
* **Fixed** `4372 `_: Text insertion fails due to missing /Resources object
* **Fixed** `4400 `_: Infinite loop in fill_textbox
* **Fixed** `4403 `_: Unable to get_text() - layer/clip nesting too deep
* **Fixed** `4415 `_: PDF page is mirrored, origin is at bottom-left
* Other:
* Use MuPDF-1.25.6.
* Fixed MuPDF SEGV on MacOS with particular fonts.
* Fixed `Annot.get_textpage()`'s `clip` arg.
* Fixed Python-3.14 (pre-release) build error.
**Changes in version 1.25.4 (2025-03-14)**
* Use MuPDF-1.25.5.
* Fixed issues:
* **Fixed** `4079 `_: Unexpected result for apply_redactions()
* **Fixed** `4224 `_: MuPDF error: format error: negative code in 1d faxd
* **Fixed** `4303 `_: page.get_image_info() returns outdated cached results after replacing image
* **Fixed** `4309 `_: FzErrorFormat Error When Deleting First Page
* **Fixed** `4336 `_: Major Performance Regression: pix.color_count is 150x slower in version 1.25.3 compared to 1.23.8
* **Fixed** `4341 `_: Invalid label retrieval when /Kids is an array of multiple /Nums
* Other:
* Fixed handling of duplicate widget names when joining PDFs (PR #4347).
* Improved Pyodide build.
* Avoid SWIG-related build errors with Python-3.13 by disabling PY_LIMITED_API.
**Changes in version 1.25.3 (2025-02-06)**
* Use MuPDF-1.25.4.
* Fixed issues:
* **Fixed** `4139 `_: Text color numbers change between 1.24.14 and 1.25.0
* **Fixed** `4141 `_: Some insertion methods fails for pages without a /Resources object
* **Fixed** `4180 `_: Search problems
* **Fixed** `4182 `_: Text coordinate extraction error
* **Fixed** `4245 `_: Highlighting issue distorted on recent versions
* **Fixed** `4254 `_: add_freetext_annot is drawing text outside the annotation box
* Other:
* In annotations:
* Added support for subtype FreeTextCallout.
* Added support for rich text.
* Added miter_limit arg to insert_text*() to allow suppression of spikes caused by long miters.
* Add Widget Support to `Document.insert_pdf()`.
* Add `bibi` to span dicts.
* Add `synthetic' to char dict.
* Fixed Pyodide builds.
**Changes in version 1.25.2 (2025-01-17)**
* Fixed issues:
* **Fixed** `4055 `_: "Yes" for all checkboxes does not work for all PDF rendering engines.
* **Fixed** `4155 `_: samples_mv is unsafe
* **Fixed** `4162 `_: Got AttributeError, when tried to add Signature field
* **Fixed** `4186 `_: Incorrect handling of JPEG with color space CMYK image extraction
* **Fixed** `4195 `_: Pixmaps that are inverted and have an alpha channel are not rendered properly
* **Fixed** `4225 `_: pixmap.pil_save() fails due to colorspace definition
* **Fixed** `4232 `_: Incorrect Font style and Size
* Other:
* Use Python's built-in glyphname <> unicode conversion.
* Improve speed of pixmap color inversion.
* Add new `char_flags` member to span dictionary, for example allows detection of invisible text.
* Detect image masks in TextPage output.
* Added `Pixmap.pil_image()`.
**Changes in version 1.25.1 (2024-12-11)**
* Use MuPDF-1.25.2.
* Fixed issues:
* **Fixed** `4125 `_: memory leak while convert Pixmap's colorspace
* **Fixed** `4034 `_: Possible regression in pdf cleaning during save.
**Changes in version 1.25.0 (2024-12-05)**
* Use MuPDF-1.25.1.
* Fixed issues:
* **Fixed** `4026 `_: page.get_text('blocks') output two piece of very similar text with different bbox
* **Fixed** `4004 `_: Segmentation Fault When Updating PDF Form Field Value
* **Fixed** `3887 `_: Subset Fonts problem using Fallback Font
* **Fixed** `3886 `_: Another issue with destroying PDF when inserting html
* **Fixed** `3751 `_: apply_redactions causes part of the page content to be hidden / transparent
.. codespell:ignore-begin
**Changes in version 1.24.14 (2024-11-19)**
* Use MuPDF-1.24.11.
* Fixed issues:
* **Fixed** `3448 `_: get_pixmap function removes the table and leaves just the content behind
* **Fixed** `3758 `_: Got "malloc(): unaligned tcache chunk detected Aborted (core dumped)" while using add_redact_annot/apply_redactions
* **Fixed** `3813 `_: Stories: Ordered list count broken with nested unordered list
* **Fixed** `3933 `_: font.valid_codepoints() - malfunction
* **Fixed** `4018 `_: PyMuPDF hangs when iterating over zero page PDF pages backwards
* **Fixed** `4043 `_: fullcopypage bug
* **Fixed** `4047 `_: Segmentation Fault in add_redact_annot
* **Fixed** `4050 `_: Content of dict returned by doc.embfile_info() does not fit to documentation
* Other:
* Ensure that words from `Page.get_text()` never contain RTL/LTR char mixtures.
* Fix building with system MuPDF.
* Add dot product for points and vectors.
**Changes in version 1.24.13 (2024-10-29)**
* Fixed issues:
* **Fixed** `3848 `_: Piximap program crash
* **Fixed** `3950 `_: Unable to consistently extract field labels from PDFs
* **Fixed** `3981 `_: PyMuPDF 1.24.12 with pyinstaller throws error.
* **Fixed** `3994 `_: pix.color_topusage raise Segmentation fault (core dumped)
**Changes in version 1.24.12 (2024-10-21)**
* Fixed issues:
* **Fixed** `3914 `_: Ability to print MuPDF errors to logging instead of stdout
* **Fixed** `3916 `_: insert_htmlbox error: int too large to convert to float
* **Fixed** `3950 `_: Unable to consistently extract field labels from PDFs
* Supported Python versions are now 3.9-3.13.
* Dropped support for Python-3.8 because end-of-life.
* Added support for Python-3.13 because now released.
* See: https://devguide.python.org/versions/
**Changes in version 1.24.11 (2024-10-03)**
* Use MuPDF-1.24.10.
* Fixed issues:
* **Fixed** `3624 `_: Pdf file transform to image have a black block
* **Fixed** `3859 `_: doc.need_appearances() fails with "AttributeError: module 'pymupdf.mupdf' has no attribute 'PDF_TRUE' "
* **Fixed** `3863 `_: apply_redactions() does not work as expected
* **Fixed** `3905 `_: open stream can raise a FzErrorFormat error instead of FileDataError
* Wheels now use the Python Stable ABI:
* There is one PyMuPDF wheel for each platform.
* Each wheel works with all supported Python versions.
* Each wheel is built using the oldest supported Python version (currently 3.8).
* There is no PyMuPDFb wheel.
* Other:
* Improvements to get_text_words() with sort=True.
* Tests now always get the latest versions of required Python packages.
* Removed dependency on setuptools.
* Added item to PyMuPDF-1.24.10 changes below - fix of #3630.
**Changes in version 1.24.10 (2024-09-02)**
* Use MuPDF-1.24.9.
* Fixed issues:
* **Fixed** `3450 `_: get_pixmap function takes too long to process
* **Fixed** `3569 `_: Invalid OCGs not ignored by SVG image creation
* **Fixed** `3603 `_: ObjStm compression and PDF linearization doesn't work together
* **Fixed** `3650 `_: Linebreak inserted between each letter
* **Fixed** `3661 `_: Update Document to check the /XYZ len
* **Fixed** `3698 `_: documentation issue - old code in the annotations documentation
* **Fixed** `3705 `_: Document.select() behaves weirdly in some particular kind of pdf files
* **Fixed** `3706 `_: extend Document.__getitem__ type annotation to reflect that the method also accepts slices
* **Fixed** `3727 `_: Method get_pixmap() make the program exit without any exceptions or messages
* **Fixed** `3767 `_: Cannot get Tessdata with Tesseract-OCR 5
* **Fixed** `3773 `_: Link.set_border gives TypeError: '<' not supported between instances of 'NoneType' and 'int'
* **Fixed** `3774 `_: fitz.__version__` does not work anymore
* **Fixed** `3789 `_: ValueError: not enough values to unpack (expected 3, got 2) is thrown when call insert_pdf
* **Fixed** `3820 `_: class improves namedDest handling
* **Fixed** `3630 `_: page.apply_redactions gives unwanted black rectangle
* Other:
* Object streams and linearization cannot be used together; attempting to do
so will raise an exception. (#3603)
* Fixed handling of non-existing /Contents object.
**Changes in version 1.24.9 (2024-07-24)**
* Use MuPDF-1.24.8.
**Changes in version 1.24.8 (2024-07-22)**
* Fixed issues:
* **Fixed** `3636 `_: API documentation for the open function is not obvious to find.
* **Fixed** `3654 `_: docx parsing was broken in 1.24.7
* **Fixed** `3677 `_: Unable to extract subset font name using the newer versions of PyMuPDF : 1.24.6 and 1.24.7.
* **Fixed** `3687 `_: Page.get_text results in AssertionError for epub files
Other:
* Fixed various spelling mistakes spotted by codespell.
* Improved how we modify MuPDF's default configuration on Windows.
* Make text search to work with ligatures.
**Changes in version 1.24.7 (2024-06-26)**
* Fixed issues:
* **Fixed** `3615 `_: Document.pagemode or Document.pagelayout crashes for epub files
* **Fixed** `3616 `_: not last version reported
**Changes in version 1.24.6 (2024-06-25)**
* Use MuPDF-1.24.4
* Fixed issues:
* **Fixed** `3599 `_: Story.fit_width() has a weird line
* **Fixed** `3594 `_: Garbled extraction for Amazon Sustainability Report
* **Fixed** `3591 `_: 'width' in Page.get_drawings() returns width equal as 0
* **Fixed** `3561 `_: ZeroDivisionError: float division by zero with page.apply_redactions()
* **Fixed** `3559 `_: SegFault 11 when empty H1 H2 H3 H4 etc element is used in insert_htmlbox
* **Fixed** `3539 `_: Add dotted gridline detection to table recognition
* **Fixed** `3519 `_: get_toc(simple=False) AttributeError: 'Outline' object has no attribute 'rect'
* **Fixed** `3510 `_: page.get_label() gets wrong label on the first page of doc
* **Fixed** `3494 `_: 1.24.2/1.24.3: spurious characters introduced when using subset_fonts and insert_pdf
* **Fixed** `3470 `_: subset_fonts error exit without exception/warning
* **Fixed** `3400 `_: set_toc alters link coordinates for some rotated pages on pymupdf 1.24.2
* **Fixed** `3347 `_: Incorrect links to points on pages having different heights
* **Fixed** `3237 `_: Set_metadata() does not work
* **Fixed** `3493 `_: Isolate PyMuPDF from other libraries; issues when PyMuPDF is loaded with other libraries like GdkPixbuf
* Other:
* Fixed concurrent use of PyMuPDF caused by use of constant temporary filenames.
* Add musllinux x86_64 wheels to release.
* Added clearer version information:
* `pymupdf.pymupdf_version`.
* `pymupdf.mupdf_version`.
* `pymupdf.pymupdf_date`.
**Changes in version 1.24.5 (2024-05-30)**
* Fixed issues:
* **Fixed** `3479 `_: regression: fill_textbox: IndexError: pop from empty list
* **Fixed** `3488 `_: set_toc method error
* Other:
* Some more fixes to use MuPDF floating formatting.
* Removed/disabled some unnecessary diagnostics.
* Fixed utils.do_links() crash.
* Experimental new functions `pymupdf.apply_pages()` and `pymupdf.get_text()`.
* Addresses wrong label generation for label styles "a" and "A".
**Changes in version 1.24.4 (2024-05-16)**
* **Fixed** `3418 `_: Re-introduced bug, text align add_redact_annot
* **Fixed** `3472 `_: insert_pdf gives SystemError
* Other:
* Fixed sysinstall test failing to remove all of prior installation before
new install.
* Fixed `utils.do_links()` crash.
* Correct `TextPage` creation Code.
* Unified various diagnostics.
* Fix bug in `page_merge()`.
**Changes in version 1.24.3 (2024-05-09)**
*
The Python module is now called `pymupdf`. `fitz` is still supported for
backwards compatibility.
* Use MuPDF-1.24.2.
* Fixed issues:
* **Fixed** `3357 `_: PyMuPDF==1.24.0 will hanging when using page.get_text("text")
* **Fixed** `3376 `_: Redacting results are not as expected in 1.24.x.
* **Fixed** `3379 `_: Documentation mismatch for get_text_blocks return value order.
* **Fixed** `3381 `_: Contents stream contains floats in scientific notation
* **Fixed** `3402 `_: Cannot add Widgets containing inter-field-calculation JavaScript
* **Fixed** `3414 `_: missing attribute set_dpi()
* **Fixed** `3430 `_: page.get_text() cause process freeze with certain pdf on v1.24.2
* Other:
* New/modified methods:
* `Page.remove_rotation()`: new, set page rotation to zero while keeping appearance.
* Fixed some problems when checking for PDF properties.
* Fixed pip builds from sdist
(see discussion `3360 `_:
Alpine linux docker build failing "No matching distribution found for pymupdfb==1.24.1").
**Changes in version 1.24.2 (2024-04-17)**
* Removed obsolete classic implementation from releases
(previously available as module `fitz_old`).
* Fixed issues:
* **Fixed** `3331 `_: Document.pages() is incorrectly type-hinted
* **Fixed** `3354 `_: PyMuPDF==1.24.1: AttributeError: property 'metadata' of 'Document' object has no setter
* Other:
* New/modified methods:
* `Document.bake()`: new, make annotations / fields permanent content.
* `Page.cluster_drawings()`: new, identifies drawing items
(i.e. vector graphics or line-art)
that belong together based on their geometrical vicinity.
* `Page.apply_redactions()`: added new parameter `text`.
* `Document.subset_fonts()`: use MuPDF's `pdf_subset_fonts()` instead of PyMuPDF code.
* The `Document` class now supports page numbers specified as slices.
* Avoid causing MuPDF warnings.
**Changes in version 1.24.1 (2024-04-02)**
* Fixed issues:
* **Fixed** `3278 `_: apply_redactions moves some unredacted text
* **Fixed** `3301 `_: Be more permissive when classifying links as kind LINK_URI
* **Fixed** `3306 `_: Text containing capital 'ET' not appearing as annotation
* Other:
* Use MuPDF-1.24.1.
* Support ObjStm Compression.
Methods `Document.save()`, `Document.ez_save()` and `Document.write()`
now support new parameters `use_objstm`, compression_effort` and
`preserve_metadata`.
**Changes in version 1.24.0 (2024-03-21)**
* Fixed issues:
* **Fixed** `3281 `_: Preparing metadata (pyproject.toml) did not run successfully
* **Fixed** `3279 `_: PyMuPDF no longer builds in Alpine Linux
* **Fixed** `3257 `_: apply_redactions() deleting text outside of annotated box
* **Fixed** `3216 `_: AttributeError: 'Annot' object has no attribute '__del__'
* **Fixed** `3207 `_: get_drawings's items is missing line from h path operator
* **Fixed** `3201 `_: Memory leaks when merging PDFs
* **Fixed** `3197 `_: page.get_text() returns hexadecimal text for some characters
* **Fixed** `3196 `_: Remove text not working in 1.23.25 version vs 1.20.2
* **Fixed** `3172 `_: PDF's 45º lines disappearing in png conversion
* **Fixed** `3135 `_: Do not log warnings to stdout
* **Fixed** `3125 `_: get_pixmap method stuck on one page and runs forever
* **Fixed** `2964 `_: There is an issue with the image generated by the page.get_pixmap() function
* Other:
* Use MuPDF-1.24.0.
* Add support for redacting vector graphics.
* Several fixes for table module
* Add new method for outputting the table as a markdown string.
* Address errors in computing the table header object:
We now allow None as the cell value, because this will be resolved where
needed (e.g. in the pandas DataFrame).
We previously tried to enforce rect-like tuples in all header cell
bboxes, however this fails for tables with all-None columns. This fix
enables this and constructs an empty string in the corresponding cell
string.
We now correctly include start / stop points of lines in the bbox of the
clustered graphic. We previously joined the line's rectangle - which had
no effect because this is always empty.
* Improved exception text if we fail to open document.
* Fixed build with new libclang 18.
**Changes in version 1.23.26 (2024-02-29)**
* Fixed issues:
* **Fixed** `3199 `_: Add entry_points to setuptools configuration to provide command-line console scripts
* **Fixed** `3209 `_: Empty vertices in ink annotation
* Other:
* Improvements to table detection:
* Improved check for empty tables, fixes bugs when determining table headers.
* Improved computation of enveloping vector graphic rectangles.
* Ignore more meaningless "pseudo" tables
* Install command-line 'pymupdf' command that runs fitz/__main__.py.
* Don't overwrite MuPDF's config.h when building on non-Windows.
* Fix `Story` constructor's `archive` arg to match docs - now accepts a single `Archive` constructor arg.
* Do not include MuPDF source in sdist; will be downloaded automatically when building.
**Changes in version 1.23.25 (2024-02-20)**
* Fixed issues:
* **Fixed** `3182 `_: Pixmap.invert_irect argument type error
* **Fixed** `3186 `_: extractText() extracts broken text from pdf
* **Fixed** `3191 `_: Error on .find_tables()
* Other:
* When building, be able to specify python-config directly, with environment
variable `PIPCL_PYTHON_CONFIG`.
**Changes in version 1.23.24 (2024-02-19)**
* Fixed issues:
* **Fixed** `3148 `_: Table extraction - vertical text not handled correctly
* **Fixed** `3179 `_: Table Detection: Incorrect Separation of Vector Graphics Clusters
* **Fixed** `3180 `_: Cannot show optional content group: AttributeError: module 'fitz.mupdf' has no attribute 'pdf_array_push_drop'
* Other:
* Be able to test system install using `sudo pip install` instead of a venv.
**Changes in version 1.23.23 (2024-02-18)**
* Fixed issues:
* **Fixed** `3126 `_: Initialising Archive with a pathlib.Path fails.
* **Fixed** `3131 `_: Calling the next attribute of an Annot raises a "No attribute .parent" warning
* **Fixed** `3134 `_: Using an IRect as clip parameter in Page.get_pixmap no longer works since 1.23.9
* **Fixed** `3140 `_: PDF document stays in use after closing
* **Fixed** `3150 `_: doc.select() hangs on this doc.
* **Fixed** `3163 `_: AssertionError on using fitz.IRect
* **Fixed** `3177 `_: fitz.Pixmap(None, pix) Unrecognised args for constructing Pixmap
* Other:
*
Improved `Document.select() by using new MuPDF function
`pdf_rearrange_pages()`. This is a more complete (and faster)
implementation of what needs to be done here in that not only pages will
be rearranged, but also consequential changes will be made to the table
of contents, links to removed pages and affected entries in the Optional
Content definitions.
* `TextWriter.appendv()`: added `small_caps` arg.
* Fixed some valgrind errors with MuPDF master.
* Fixed `Document.insert_image()` when build with MuPDF master.
**Changes in version 1.23.22 (2024-02-12)**
* Fixed issues:
* **Fixed** `3143 `_: Difference in decoding of OCGs names between doc.get_ocgs() and page.get_drawings()
* **Fixed** `3139 `_: Pixmap resizing needs positional arg "clip" - even if None.
* Other:
* Removed the use of MuPDF function `fz_image_size()` from PyMuPDF.
**Changes in version 1.23.21 (2024-02-01)**
* Fixed issues:
* Other:
* Fixed bug in set_xml_metadata(), PR `3112 `_: Fix pdf_add_stream metadata error
* Fixed lack of `.parent` member in `TextPage` from `Annot.get_textpage()`.
* Fixed bug in `Page.add_widget()`.
**Changes in version 1.23.20 (2024-01-29)**
* Bug fixes:
* **Fixed** `3100 `_: Wrong internal property accessed in get_xml_metadata
* Other:
* Significantly improved speed of `Document.get_toc()`.
**Changes in version 1.23.19 (2024-01-25)**
* Bug fixes:
* **Fixed** `3087 `_: Exception in insert_image with mask specified
* **Fixed** `3094 `_: TypeError: '<' not supported between instances of 'FzLocation' and 'int' in doc.delete_pages
* Other:
* When finding tables:
* Allow addition of user-defined "virtual" vector graphics when finding tables.
* Confirm that the enveloping bboxes of vector graphics are inside the clip rectangle.
* Avoid slow finding of rectangle intersections.
* Added `Font.bbox` property.
**Changes in version 1.23.18 (2024-01-23)**
* Bug fixes:
* **Fixed** `3081 `_: doc.close() not closing the document
* Other:
* Reduced size of sdist to fit on pypi.org (by reducing size of two test files).
* Fix `Annot.file_info()` if no `Desc` item.
**Changes in version 1.23.17 (2024-01-22)**
* Bug fixes:
* **Fixed** `3062 `_: page_rotation_reset does not return page to original rotation
* **Fixed** `3070 `_: update_link(): AttributeError: 'Page' object has no attribute 'super'
* Other:
* Fixed bug in `Page.links()` (PR #3075).
* Fixed bug in `Page.get_bboxlog()` with layers.
* Add support for timeouts in scripts/ and tests/run_compound.py.
**Changes in version 1.23.16 (2024-01-18)**
* Bug fixes:
* **Fixed** `3058 `_: Pixmap created from CMYK JPEG delivers RGB format
* Other:
* In table detection strategy "lines_strict", exclude fill-only vector graphics.
* Fixed sysinstall test failure.
* In documentation, update feature matrix with item about text writing.
**Changes in version 1.23.15 (2024-01-16)**
* Bug fixes:
* **Fixed** `3050 `_: python3.9 pix.set_pixel has something wrong in c.append( ord(i))
* Other:
* Improved docs for Page.find_tables().
**Changes in version 1.23.14 (2024-01-15)**
* Bug fixes:
* **Fixed** `3038 `_: JM_pixmap_from_display_list > Assertion Error : Checking for wrong type
* **Fixed** `3039 `_: Issue with doc.close() not closing the document in PyMuPDF
* Other:
* Ensure valid "re" rectangles in `Page.get_drawings()` with derotated pages.
**Changes in version 1.23.13 (2024-01-15)**
* Bug fixes:
* **Fixed** `2979 `_: list index out of range in to_pandas()
* **Fixed** `3001 `_: Calling find_tables() on one document alters the bounding boxes of a subsequent document
* Other:
* Fixed `Rect.height` and `Rect.width` to never return negative values.
* Fixed `TextPage.extractIMGINFO()`'s returned `dictkey_yres` value.
**Changes in version 1.23.12 (2024-01-12)**
* * **Fixed** `3027 `_: Page.get_text throws Attribute Error for 'parent'
**Changes in version 1.23.11 (2024-01-12)**
* Fixed some Pixmap construction bugs.
* Fixed Pixmap.yres().
**Changes in version 1.23.10 (2024-01-12)**
* Bug fixes:
* **Fixed** `3020 `_: Can't resize a PixMap
* Other:
* Fixed Page.delete_image().
**Changes in version 1.23.9 (2024-01-11)**
* Default to new "rebased" implementation.
* The old "classic" implementation is available with `import fitz_old as fitz`.
* For more information about why we are changing to the rebased implementation,
see: https://github.com/pymupdf/PyMuPDF/discussions/2680
* Use MuPDF-1.23.9.
* Bug fixes (rebased implementation only):
* **Fixed** `2911 `_: Page.derotation_matrix returns a tuple instead of a Matrix with rebased implementation
* **Fixed** `2919 `_: Rebased version: KeyError in resolve_names when merging pdfs
* **Fixed** `2922 `_: New feature that allows inserting named-destination links doesn't work
* **Fixed** `2943 `_: ZeroDivisionError: float division by zero when use apply_redactions()
* **Fixed** `2950 `_: Shelling out to pip during tests is problematic
* **Fixed** `2954 `_: Replacement unicode character in text extraction
* **Fixed** `2957 `_: apply_redactions() moving text
* **Fixed** `2961 `_: Passing a string as a page number raises IndexError instead of TypeError.
* **Fixed** `2969 `_: annot.next throws AttributeError
* **Fixed** `2978 `_: 1.23.9rc1: module 'fitz.mupdf' has no attribute 'fz_copy_pixmap_rect'
* **Fixed** `2907 `_: segfault trying to call clean_contents on certain pdfs with python 3.12
* **Fixed** `2905 `_: SystemError: returned a result with an exception set
* **Fixed** `2742 `_: Segmentation Fault when inserting three (but not two) copies of the same source page into one destination page
* Other:
* Add optional setting of opacity to `Page.insert_htmlbox()`.
* Fixed issue with add_redact_annot() mentioned in #2934.
* Fixed `Page.rotation()` to return 0 for non-PDF documents instead of raising an exception.
* Fixed internal quad detection to cope with any Python sequence.
* Fixed rebased `fitz.pymupdf_version_tuple` - was previously set to mupdf version.
* Improved support for Linux system installs, including adding regular testing on Github.
* Add missing `flake8` to `scripts/gh_release.py:test_packages`.
* Use newly public functions in MuPDF-1.23.8.
* Improved `scripts/test.py` to help investigation of MuPDF issues.
**Changes in version 1.23.8 (2023-12-19)**
* Bug fixes (rebased implementation only):
* **Fixed** `2634 `_: get_toc and set_toc do not behave consistently for rotated pages
* **Fixed** `2861 `_: AttributeError in getLinkDict during PDF Merge
* **Fixed** `2871 `_: KeyError in getLinkDict during PDF merge
* **Fixed** `2886 `_: Error in Skeleton for Named Link Destinations
* Bug fixes (rebased and classic implementations):
* **Fixed** `2885 `_: pymupdf find tables too slow
* Other:
* Rebased implementation:
* `Page.insert_htmlbox()`: new, much more powerful alternative to `Page.insert_textbox()` or `TextWriter.fill_textbox()`, using `Story`.
* `Story.fit*()`: new methods for fitting a Story into an expanded rect.
* `Story.write_with_links()`: add support for external links.
* `Document.language()`: fixed to use MuPDF's new `mupdf.fz_string_from_text_language2()`.
* `Document.subset_fonts()` - fixed.
* Fixed internal `Archive._add_treeitem()` method.
* Fixed `fitz_new.__doc__` to contain PyMuPDF and Python version information, and OS name.
* Removed use of `(*args, **kwargs)` in API, we now specify keyword args explicitly.
* Work with new MuPDF Python exception classes.
* Fixed bug where `button_states()` returns None when `/AP` points to an indirect object.
* Fixed pillow test to not ignore all errors, and install pillow when testing.
* Added test for `fitz.css_for_pymupdf_font()` (uses package `pymupdf-fonts`).
* Simplified Github Actions test specifications.
* Updated `tests/README.md`.
**Changes in version 1.23.7 (2023-11-30)**
* Bug fixes in rebased implementation, not fixed in classic implementation:
* **Fixed** `2232 `_: Geometry helper classes should support keyword arguments
* **Fixed** `2788 `_: Problem with get_toc in pymupdf 1.23.6
* **Fixed** `2791 `_: Experiencing small memory leak in save()
* Bug fixes (rebased and classic implementations):
* **Fixed** `2736 `_: Failure when set cropbox with mediabox negative value
* **Fixed** `2749 `_: RuntimeError: cycle in structure tree
* **Fixed** `2753 `_: Story.write_with_links will ignore everything after the first "page break" in the HTML.
* **Fixed** `2812 `_: find_tables on landscape page generates reversed text
* **Fixed** `2829 `_: [cannot create /Annot for kind] is still printed despite #2345 is closed.
* **Fixed** `2841 `_: Unexpected KeyError when using scrub with fitz_new
* Use MuPDF-1.23.7.
* Other:
* Rebased implementation:
* Added flake8 code checking to test suite, and made various fixes.
* Disable diagnostics during Document constructor to match classic implementation.
* Additional fix to `2553 `_: Invalid characters in versions >= 1.22
* Fixed `MuPDF Bug 707324 `_: Story: HTML table row background color repeated incorrectly
* Added `scripts/test.py`, for simple build+test of PyMuPDF git checkout.
* Added `fitz.pymupdf_version_tuple`, e.g. `(1, 23, 6)`.
* Restored mistakenly-reverted fix for `2345 `_: Turn off print statements in utils.py
* Include any trailing `... repeated times...` text in warnings returned by `mupdf_warnings()` (rebased only).
**Changes in version 1.23.6 (2023-11-06)**
* Bug fixes:
* **Fixed** `2553 `_: Invalid characters in versions >= 1.22
* **Fixed** `2608 `_: Incorrect utf32 text extraction (high & low surrogates are split)
* **Fixed** `2710 `_: page.rect and text location wrong / differing from older version
* **Fixed** `2774 `_: wrong encoding for "\?" character when sort=True
* **Fixed** `2775 `_: fitz_new does not work with python3.10 or earlier
* **Fixed** `2777 `_: With fitz_new, wrong type for Page.mediabox
* Other:
* Use MuPDF-1.23.5.
* Added Document.resolve_names() (rebased implementation only).
**Changes in version 1.23.5 (2023-10-11)**
* Bug fixes:
* **Fixed** `2341 `_: Handling negative values in the zoom section for LINK_GOTO in linkDest
* **Fixed** `2522 `_: Typo in set_layer() - NameError: name 'f' is not defined
* **Fixed** `2548 `_: Fitz freezes on some PDFs when calling the fitz.Page.get_text_blocks method.
* **Fixed** `2596 `_: save(garbage=3) breaks get_pixmap() with side effect
* **Fixed** `2635