[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

@ -34,12 +34,12 @@
//
// The workerSrc property shall be specified.
//
PDFJS.GlobalWorkerOptions.workerSrc =
pdfjsDistBuildPdf.GlobalWorkerOptions.workerSrc =
'../../node_modules/pdfjs-dist/build/pdf.worker.js';
// Opening PDF by passing its binary data as a string. It is still preferable
// to use Uint8Array, but string or array-like structure will work too.
PDFJS.getDocument({data: pdfData}).then(function getPdfHelloWorld(pdf) {
pdfjsDistBuildPdf.getDocument({data: pdfData}).then(function getPdfHelloWorld(pdf) {
// Fetch the first page.
pdf.getPage(1).then(function getPageHelloWorld(page) {
var scale = 1.5;