New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

mupdf

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mupdf

MuPDF.js

  • 0.1.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.5K
decreased by-7.47%
Maintainers
1
Weekly downloads
 
Created
Source

MuPDF.js

This is a build of MuPDF for JavaScript & WebAssembly environments.

The MuPDF.js library (lib/mupdf.js) can be used both in browsers and in Node.js.

Features

  • Fast rendering of PDF files
  • Search PDF files
  • PDF editing & annotations
  • Get PDF metadata information
  • Manage PDF passwords
  • Supports basic CJK (Chinese, Japanese, Korean) fonts

Getting started using NPM

From the command line, go to the folder you want to work from and run:

npm install mupdf

To verify your installation you can create a file test.js with the following script:

const mupdf = require("mupdf")
console.log(mupdf)

Then, on the command line, run:

node test.js

If all is well, this will print the mupdf module object to the console.

Loading a document

The following example demonstrates how to load a document and then print out the page count. Ensure you have a my_document.pdf file alongside this example before trying it.

const fs = require("fs")
const mupdf = require("mupdf")
var data = fs.readFileSync("my_document.pdf")
var doc = mupdf.Document.openDocument(data, "application/pdf")
console.log(doc.countPages())

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.

Documentation

For documentation please refer to: mupdf.readthedocs.io.

Examples

Check the Github repo for example implementations including a simple PDF Viewer to help you get started.


Getting Started with Local Development

You can build the MuPDF.js WebAssembly libraries from source by referring to BUILDING.md.

From here you can then try adding code to the main library file mupdf.js or adding your own JavaScript files or implementations.

Contributing

To contribute please open up (or help answer!) an Issue on our Github board and create a Pull Request (PR) for review. Find us on Discord at #mupdf-js to chat with us directly.

Keywords

FAQs

Package last updated on 29 Jan 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc