Welcome to the official MuPDF.js library from Artifex.
This is a build of MuPDF for JavaScript and TypeScript, powered by WebAssembly.
The MuPDF.js library can be used in all common JavaScript environments: Firefox, Safari, Chrome, Node, Bun, and many others.
You can use MuPDF.js to build a PDF viewer, or a PDF editor, or to batch convert PDF files to other formats, or extract text contents. If you can imagine it, you can build it!
- Open, manipulate, and save PDF files
- Render documents to raster images
- Extract structured text
- Create and edit annotations
- Fill out forms
- Redact sensitive content
MuPDF.js is available under Open Source AGPL and commercial license agreements. If you determine you cannot meet the requirements of the AGPL, please contact Artifex for more information regarding a commercial license.
See INSTALL.md for how to get started using the library.
Check out the example projects to help you get started. The examples include a simple PDF Viewer that runs MuPDF in the browser, several command line scripts, and more!
See BUILDING.md for instructions on building the MuPDF.js library from source.
This is the stable API that shares its design with our other language bindings for the mutool run command line environment and the Java and Android libraries. Using this API gives you full control, but assumes some basic knowledge about the PDF file format internals.
The documentation for this module is available here:
https://mupdf.readthedocs.io/en/latest/mupdf-js.html
This is a new and experimental API that aims to provide higher level functionality much like pymupdf does for Python.
The documentation for this module is available here:
https://mupdfjs.readthedocs.io/en/latest/
To contribute please open up (or help answer!) an Issue on our Github project, or create a Pull Request for review.
Find us on Discord at #mupdf-js to chat with us directly.