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

Rename the globals to shorter names.

pdfjsDistBuildPdf=pdfjsLib
pdfjsDistWebPdfViewer=pdfjsViewer
pdfjsDistBuildPdfWorker=pdfjsWorker
This commit is contained in:
Brendan Dahl 2018-03-15 13:49:28 -07:00
parent 6662985a20
commit 01bff1a81d
14 changed files with 66 additions and 68 deletions

View file

@ -15,7 +15,7 @@
'use strict';
pdfjsDistBuildPdf.GlobalWorkerOptions.workerSrc =
pdfjsLib.GlobalWorkerOptions.workerSrc =
'../../node_modules/pdfjs-dist/build/pdf.worker.js';
var DEFAULT_URL = '../../test/pdfs/f1040.pdf';
@ -24,7 +24,7 @@ var DEFAULT_SCALE = 1.0;
var container = document.getElementById('pageContainer');
// Fetch the PDF document from the URL using promises.
pdfjsDistBuildPdf.getDocument(DEFAULT_URL).then(function (doc) {
pdfjsLib.getDocument(DEFAULT_URL).then(function (doc) {
// Use a promise to fetch and render the next page.
var promise = Promise.resolve();
@ -32,12 +32,12 @@ pdfjsDistBuildPdf.getDocument(DEFAULT_URL).then(function (doc) {
promise = promise.then(function (pageNum) {
return doc.getPage(pageNum).then(function (pdfPage) {
// Create the page view.
var pdfPageView = new pdfjsDistWebPdfViewer.PDFPageView({
var pdfPageView = new pdfjsViewer.PDFPageView({
container: container,
id: pageNum,
scale: DEFAULT_SCALE,
defaultViewport: pdfPage.getViewport(DEFAULT_SCALE),
annotationLayerFactory: new pdfjsDistWebPdfViewer.DefaultAnnotationLayerFactory(),
annotationLayerFactory: new pdfjsViewer.DefaultAnnotationLayerFactory(),
renderInteractiveForms: true,
});