1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 01:58:06 +02:00

Adds/modifies examples for node.js and webpack.

This commit is contained in:
Yury Delendik 2015-12-21 13:46:50 -06:00
parent 9228e1ffcf
commit 79c2f69c32
15 changed files with 170 additions and 19 deletions

View file

@ -8,14 +8,10 @@
var fs = require('fs');
// HACK few hacks to let PDF.js be loaded not as a module in global space.
global.window = global;
global.navigator = { userAgent: 'node' };
global.PDFJS = {};
require('./domstubs.js');
PDFJS.workerSrc = true;
require('../../build/singlefile/build/pdf.combined.js');
// Run `node make dist` to generate 'pdfjs-dist' npm package files.
require('../../build/dist');
// Loading file from file system into typed array
var pdfPath = process.argv[2] || '../../web/compressed.tracemonkey-pldi-09.pdf';