0.0.12 • Published 1 year ago

@lighthousesystems/pdf-annotate.js v0.0.12

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

pdf-annotate.js

Annotation layer for pdf.js

Objectives

  • Provide a low level annotation layer for pdf.js.
  • Optional high level UI for managing annotations.
  • Agnostic of backend, just supply your own StoreAdapter to fetch/store data.
  • Prescribe annotation format.

Example

import PDFJSAnnotate from '@lighthousesystems/pdfjs-annotate';
import MyStoreAdapter from './myStoreAdapter';

const { UI } = PDFJSAnnotate;
const VIEWER = document.getElementById('viewer');
const RENDER_OPTIONS = {
  documentId: 'MyPDF.pdf',
  pdfDocument: null,
  scale: 1,
  rotate: 0
};

PDFJS.workerSrc = 'pdf.worker.js';
PDFJSAnnotate.setStoreAdapter(MyStoreAdapter);

PDFJS.getDocument(RENDER_OPTIONS.documentId).then((pdf) => {
  RENDER_OPTIONS.pdfDocument = pdf;
  VIEWER.appendChild(UI.createPage(1));
  UI.renderPage(1, RENDER_OPTIONS);
});

See more examples.

Documentation

View the docs.

Developing

# clone the repo
$ git clone https://github.com/lighthousesystems/pdf-annotate.js.git
$ cd pdf-annotate.js

# intall dependencies
$ npm install

# start example server
$ npm start
$ open http://127.0.0.1:8080

# run tests
$ npm test

License

MIT

0.0.12

1 year ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.3

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.2

3 years ago

0.0.1

3 years ago