Coder Social home page Coder Social logo

charris123 / mupdf.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from artifexsoftware/mupdf.js

0.0 0.0 0.0 110 KB

JavaScript bindings for MuPDF

Home Page: https://mupdfjs.readthedocs.io

License: GNU Affero General Public License v3.0

Shell 0.79% JavaScript 59.81% C 39.30% Makefile 0.10%

mupdf.js's Introduction

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())

License and Copyright

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.

mupdf.js's People

Contributors

ccxvii avatar jamie-lemon avatar sebras avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.