New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@hmcts/pdf-annotate

Package Overview
Dependencies
Maintainers
19
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hmcts/pdf-annotate

Fixes for rotation handling of annotations in instructure/pdf-annotates.js

latest
Source
npmnpm
Version
1.1.17
Version published
Maintainers
19
Created
Source

hmcts/pdf-annotate.js (forked from instructure/pdf-annotate.js)

build status Coverage Status

A fork of pdf-annotate.js to fix issues with rotations

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 __pdfjs from 'pdfjs-dist/build/pdf';
import PDFJSAnnotate from '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/hmcts/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

Keywords

pdf

FAQs

Package last updated on 06 Mar 2019

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