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

[api-major] Completely remove the global PDFJS object

This commit is contained in:
Jonas Jenwald 2018-02-17 23:51:24 +01:00
parent 4b4fcecf70
commit b8606abbc1
18 changed files with 323 additions and 426 deletions

View file

@ -3,16 +3,16 @@
// Hello world example for browserify.
require('pdfjs-dist');
var pdfjsLib = require('pdfjs-dist');
var pdfPath = '../helloworld/helloworld.pdf';
// Setting worker path to worker bundle.
PDFJS.GlobalWorkerOptions.workerSrc =
pdfjsLib.GlobalWorkerOptions.workerSrc =
'../../build/browserify/pdf.worker.bundle.js';
// Loading a document.
var loadingTask = PDFJS.getDocument(pdfPath);
var loadingTask = pdfjsLib.getDocument(pdfPath);
loadingTask.promise.then(function (pdfDocument) {
// Request a first page
return pdfDocument.getPage(1).then(function (pdfPage) {