pdf.js/examples/browserify
Tim van der Meij b293d1caf5 Update Webpack and Browserify example README files
Previously the commands were not properly parsed as such by GitHub
because they need to be indented with four spaces.

Furthermore, address some minor textual nits.
2016-04-06 18:36:41 +02:00
..
.gitignore Initial browserify example. 2016-04-04 11:32:01 -05:00
gulpfile.js Initial browserify example. 2016-04-04 11:32:01 -05:00
index.html Initial browserify example. 2016-04-04 11:32:01 -05:00
main.js Initial browserify example. 2016-04-04 11:32:01 -05:00
package.json Initial browserify example. 2016-04-04 11:32:01 -05:00
README.md Update Webpack and Browserify example README files 2016-04-06 18:36:41 +02:00
worker.js Initial browserify example. 2016-04-04 11:32:01 -05:00

Overview

Example to demonstrate PDF.js library usage with Browserify.

Getting started

Build project and install the example dependencies:

$ gulp dist
$ 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.

Alternatives to the gulp commands (without compression) are:

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