1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-25 17:48:07 +02:00

Adds gulp dist-install command; using pdfjs-dist package in examples.

This commit is contained in:
Yury Delendik 2017-05-10 18:28:18 -05:00
parent 9342054502
commit a18caa730d
24 changed files with 70 additions and 53 deletions

View file

@ -1,12 +1,13 @@
'use strict';
// In production, the bundled pdf.js shall be used instead of SystemJS.
Promise.all([SystemJS.import('pdfjs/display/api'),
SystemJS.import('pdfjs/display/global')])
Promise.all([System.import('pdfjs/display/api'),
System.import('pdfjs/display/global'),
System.resolve('pdfjs/worker_loader')])
.then(function (modules) {
var api = modules[0], global = modules[1];
// In production, change this to point to the built `pdf.worker.js` file.
global.PDFJS.workerSrc = '../../src/worker_loader.js';
global.PDFJS.workerSrc = modules[2];
// Fetch the PDF document from the URL using promises.
api.getDocument('helloworld.pdf').then(function (pdf) {