File: README.md

package info (click to toggle)
pdf.js 2.14.305%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 107,564 kB
  • sloc: javascript: 134,317; makefile: 15
file content (26 lines) | stat: -rw-r--r-- 987 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
## Overview

Example to demonstrate PDF.js library usage with Browserify.

## Getting started

Build project and install the example dependencies:

    $ gulp dist-install
    $ cd examples/browserify
    $ npm install

To build Browserify bundles, run `gulp build`. If you are running
a web server, you can observe the build results at
http://localhost:8888/examples/browserify/index.html

See main.js, worker.js and gulpfile.js files. Please notice that PDF.js
packaging requires packaging of the main application and PDF.js worker code,
and the `workerSrc` path shall be set to the latter file. The pdf.worker.js file
shall be excluded from the main bundle.

Alternatives to the gulp commands (without compression) are:

    $ mkdir -p ../../build/browserify
    $ node_modules/.bin/browserify main.js -u ./node_modules/pdfjs-dist/build/pdf.worker.js -o ../../build/browserify/main.bundle.js
    $ node_modules/.bin/browserify worker.js -o ../../build/browserify/pdf.worker.bundle.js