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:
parent
4b4fcecf70
commit
b8606abbc1
18 changed files with 323 additions and 426 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue