Vanilla#

You can build a simple web app without using any frameworks at all. Just use plain old vanilla JS!

The examples/simple-viewer project shows how to create a simple document viewer that runs MuPDF.js in a Web Worker.

The Worker runs on a background thread to do the heavy lifting, and inserts rendered images and text in the DOM as pages scroll into view.

Getting Started#

Once you have checked out the example from our Github repository then do the following:

Initialize the project#

npm install

Start the server#

To start the HTTP server and open your browser to the viewer:

npm start

Once opened in the browser use the File option in the UI to open a PDF file.