8.7.4 • Published 11 months ago

@pdftron/pdfjs-express-viewer v8.7.4

Weekly downloads
-
License
SEE LICENSE IN PD...
Repository
-
Last release
11 months ago

WebViewer

PDFJS Express is a powerful JavaScript-based PDF Library that wraps PDF.js. It provides a slick out-of-the-box responsive UI that interacts with the core library to view, annotate and manipulate PDFs that can be embedded into any web project.

This version of the product is a PDF Viewer (no annotations) and is available to use for free. Get your free license on your PDF.js Express Dashboard.

WebViewer UI

Usage

1) Install PDFJS Express

npm i @pdftron/pdfjs-express-viewer --save

This will also download all the assets that need to be included for PDFJS Express to work.

2) Copy assets and resources to your public/static folder

These assets need to be served with your application. For example, if your project is built into a dist folder, you could copy these assets into dist/public.

The folder you need to copy is node_modules/@pdftron/pdfjs-express-viewer/public.

cp -R ./node_modules/@pdftron/pdfjs-express-viewer/public ./dist

We recommend using a module bundler like Webpack to automatically do this for you. There is a nice plugin called copy-webpack-plugin that does just this.

3) Import and instantiate WebViewer

import WebViewer from '@pdftron/pdfjs-express-viewer'

const element = document.getElementById('viewer');

WebViewer({
  path: '/public', // point to where the files you copied are served from
  initialDoc: 'https://pdftron.s3.amazonaws.com/downloads/pl/PDFTRON_about.pdf' // path to your document
}, element).then((instance) => {
  // Call APIs here
})

Documentation

Full documentation for PDFJS Express can be found here.

8.7.4

11 months ago

8.7.3

1 year ago

8.7.2

1 year ago

8.7.1

1 year ago

8.7.0

2 years ago

8.4.0

2 years ago

8.3.0

2 years ago

8.2.1

2 years ago

8.2.0

2 years ago

8.1.1

3 years ago

8.1.0

3 years ago

8.1.0-alpha-2

3 years ago

8.1.0-alpha-1

3 years ago