0.8.8 • Published 1 year ago

@recogito/recogito-react-pdf v0.8.8

Weekly downloads
-
License
BSD-3-Clause
Repository
github
Last release
1 year ago

Recogito-PDF

Annotate a PDF document in React. Powered by PDF.js, RecogitoJS and Annotorious.

A screenshot of the React PDF annotation component

Using the Component

  • Import the PDFViewer component and provide the url to the PDF file
  • It's recommended to set a link to pdf.worker.js from PDF.js (copy included in folder public)
import React from 'react';
import ReactDOM from 'react-dom';
import { pdfjs, PDFViewer } from '@recogito/recogito-react-pdf';

pdfjs.GlobalWorkerOptions.workerSrc = 'pdf.worker.js';

window.onload = function() {

  // Recogito init config (optional)
  // see https://github.com/recogito/recogito-js/wiki/API-Reference
  const config = { /* ... */ };

  // Initial annotations in W3C Web Annotation format
  const annotations = [ /* ... */ ];

  // CRUD event handlers
  const onCreateAnnotation = function () { /* ... */ };
  const onUpdateAnnotation = function () { /* ... */ };
  const onDeleteAnnotation = function () { /* ... */ };

  // Viewer mode can be "paginated" or "scrolling"
  const mode = "paginated"; 

  ReactDOM.render(
    <PDFViewer
      url="compressed.tracemonkey-pldi-09.pdf" 
      mode={mode}
      config={config} 
      annotations={annotations} 
      onCreateAnnotation={onCreateAnnotation} 
      onUpdateAnnotation={onCreateAnnotation} 
      onDeleteAnnotation={onCreateAnnotation} />,
    document.getElementById('app')
  );
    
}
0.8.8

1 year ago

0.8.5

1 year ago

0.8.7

1 year ago

0.8.6

1 year ago

0.8.4

2 years ago

0.8.1

2 years ago

0.8.0

2 years ago

0.8.3

2 years ago

0.8.2

2 years ago

0.7.3

2 years ago

0.7.2

2 years ago

0.7.1

2 years ago

0.7.0

2 years ago

0.6.0

3 years ago

0.5.4

3 years ago

0.5.3

3 years ago

0.5.0

3 years ago

0.5.2

3 years ago

0.5.1

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.3.0

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago