Merge pull request #8203 from Snuffleupagus/es6-modules-web

Convert the files in the `/web` folder to ES6 modules
This commit is contained in:
Yury Delendik 2017-04-13 11:16:27 -05:00 committed by GitHub
commit 74b31ab18f
33 changed files with 1671 additions and 2115 deletions

View File

@ -13,24 +13,9 @@
* limitations under the License.
*/
'use strict';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs-web/annotation_layer_builder', ['exports',
'pdfjs-web/ui_utils', 'pdfjs-web/pdf_link_service',
'pdfjs-web/pdfjs'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('./ui_utils.js'),
require('./pdf_link_service.js'), require('./pdfjs.js'));
} else {
factory((root.pdfjsWebAnnotationLayerBuilder = {}), root.pdfjsWebUIUtils,
root.pdfjsWebPDFLinkService, root.pdfjsWebPDFJS);
}
}(this, function (exports, uiUtils, pdfLinkService, pdfjsLib) {
var mozL10n = uiUtils.mozL10n;
var SimpleLinkService = pdfLinkService.SimpleLinkService;
import { AnnotationLayer } from 'pdfjs-web/pdfjs';
import { mozL10n } from 'pdfjs-web/ui_utils';
import { SimpleLinkService } from 'pdfjs-web/pdf_link_service';
/**
* @typedef {Object} AnnotationLayerBuilderOptions
@ -87,7 +72,7 @@ var AnnotationLayerBuilder = (function AnnotationLayerBuilderClosure() {
if (self.div) {
// If an annotationLayer already exists, refresh its children's
// transformation matrices.
pdfjsLib.AnnotationLayer.update(parameters);
AnnotationLayer.update(parameters);
} else {
// Create an annotation layer div and render the annotations
// if there is at least one annotation.
@ -100,7 +85,7 @@ var AnnotationLayerBuilder = (function AnnotationLayerBuilderClosure() {
self.pageDiv.appendChild(self.div);
parameters.div = self.div;
pdfjsLib.AnnotationLayer.render(parameters);
AnnotationLayer.render(parameters);
if (typeof mozL10n !== 'undefined') {
mozL10n.translate(self.div);
}
@ -142,6 +127,7 @@ DefaultAnnotationLayerFactory.prototype = {
}
};
exports.AnnotationLayerBuilder = AnnotationLayerBuilder;
exports.DefaultAnnotationLayerFactory = DefaultAnnotationLayerFactory;
}));
export {
AnnotationLayerBuilder,
DefaultAnnotationLayerFactory,
};

View File

@ -14,95 +14,38 @@
*/
/* globals PDFBug, Stats */
'use strict';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs-web/app', ['exports', 'pdfjs-web/ui_utils',
'pdfjs-web/download_manager', 'pdfjs-web/pdf_history',
'pdfjs-web/preferences', 'pdfjs-web/pdf_sidebar',
'pdfjs-web/view_history', 'pdfjs-web/pdf_thumbnail_viewer',
'pdfjs-web/toolbar', 'pdfjs-web/secondary_toolbar',
'pdfjs-web/password_prompt', 'pdfjs-web/pdf_presentation_mode',
'pdfjs-web/pdf_document_properties', 'pdfjs-web/hand_tool',
'pdfjs-web/pdf_viewer', 'pdfjs-web/pdf_rendering_queue',
'pdfjs-web/pdf_link_service', 'pdfjs-web/pdf_outline_viewer',
'pdfjs-web/overlay_manager', 'pdfjs-web/pdf_attachment_viewer',
'pdfjs-web/pdf_find_controller', 'pdfjs-web/pdf_find_bar',
'pdfjs-web/dom_events', 'pdfjs-web/pdfjs'],
factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('./ui_utils.js'), require('./download_manager.js'),
require('./pdf_history.js'), require('./preferences.js'),
require('./pdf_sidebar.js'), require('./view_history.js'),
require('./pdf_thumbnail_viewer.js'), require('./toolbar.js'),
require('./secondary_toolbar.js'), require('./password_prompt.js'),
require('./pdf_presentation_mode.js'),
require('./pdf_document_properties.js'), require('./hand_tool.js'),
require('./pdf_viewer.js'), require('./pdf_rendering_queue.js'),
require('./pdf_link_service.js'), require('./pdf_outline_viewer.js'),
require('./overlay_manager.js'), require('./pdf_attachment_viewer.js'),
require('./pdf_find_controller.js'), require('./pdf_find_bar.js'),
require('./dom_events.js'), require('./pdfjs.js'));
} else {
factory((root.pdfjsWebApp = {}), root.pdfjsWebUIUtils,
root.pdfjsWebDownloadManager, root.pdfjsWebPDFHistory,
root.pdfjsWebPreferences, root.pdfjsWebPDFSidebar,
root.pdfjsWebViewHistory, root.pdfjsWebPDFThumbnailViewer,
root.pdfjsWebToolbar, root.pdfjsWebSecondaryToolbar,
root.pdfjsWebPasswordPrompt, root.pdfjsWebPDFPresentationMode,
root.pdfjsWebPDFDocumentProperties, root.pdfjsWebHandTool,
root.pdfjsWebPDFViewer, root.pdfjsWebPDFRenderingQueue,
root.pdfjsWebPDFLinkService, root.pdfjsWebPDFOutlineViewer,
root.pdfjsWebOverlayManager, root.pdfjsWebPDFAttachmentViewer,
root.pdfjsWebPDFFindController, root.pdfjsWebPDFFindBar,
root.pdfjsWebDOMEvents, root.pdfjsWebPDFJS);
}
}(this, function (exports, uiUtilsLib, downloadManagerLib, pdfHistoryLib,
preferencesLib, pdfSidebarLib, viewHistoryLib,
pdfThumbnailViewerLib, toolbarLib, secondaryToolbarLib,
passwordPromptLib, pdfPresentationModeLib,
pdfDocumentPropertiesLib, handToolLib, pdfViewerLib,
pdfRenderingQueueLib, pdfLinkServiceLib, pdfOutlineViewerLib,
overlayManagerLib, pdfAttachmentViewerLib,
pdfFindControllerLib, pdfFindBarLib, domEventsLib, pdfjsLib) {
var UNKNOWN_SCALE = uiUtilsLib.UNKNOWN_SCALE;
var DEFAULT_SCALE_VALUE = uiUtilsLib.DEFAULT_SCALE_VALUE;
var MIN_SCALE = uiUtilsLib.MIN_SCALE;
var MAX_SCALE = uiUtilsLib.MAX_SCALE;
var ProgressBar = uiUtilsLib.ProgressBar;
var getPDFFileNameFromURL = uiUtilsLib.getPDFFileNameFromURL;
var noContextMenuHandler = uiUtilsLib.noContextMenuHandler;
var mozL10n = uiUtilsLib.mozL10n;
var parseQueryString = uiUtilsLib.parseQueryString;
var PDFHistory = pdfHistoryLib.PDFHistory;
var Preferences = preferencesLib.Preferences;
var SidebarView = pdfSidebarLib.SidebarView;
var PDFSidebar = pdfSidebarLib.PDFSidebar;
var ViewHistory = viewHistoryLib.ViewHistory;
var PDFThumbnailViewer = pdfThumbnailViewerLib.PDFThumbnailViewer;
var Toolbar = toolbarLib.Toolbar;
var SecondaryToolbar = secondaryToolbarLib.SecondaryToolbar;
var PasswordPrompt = passwordPromptLib.PasswordPrompt;
var PDFPresentationMode = pdfPresentationModeLib.PDFPresentationMode;
var PDFDocumentProperties = pdfDocumentPropertiesLib.PDFDocumentProperties;
var HandTool = handToolLib.HandTool;
var PresentationModeState = pdfViewerLib.PresentationModeState;
var PDFViewer = pdfViewerLib.PDFViewer;
var RenderingStates = pdfRenderingQueueLib.RenderingStates;
var PDFRenderingQueue = pdfRenderingQueueLib.PDFRenderingQueue;
var PDFLinkService = pdfLinkServiceLib.PDFLinkService;
var PDFOutlineViewer = pdfOutlineViewerLib.PDFOutlineViewer;
var OverlayManager = overlayManagerLib.OverlayManager;
var PDFAttachmentViewer = pdfAttachmentViewerLib.PDFAttachmentViewer;
var PDFFindController = pdfFindControllerLib.PDFFindController;
var PDFFindBar = pdfFindBarLib.PDFFindBar;
var getGlobalEventBus = domEventsLib.getGlobalEventBus;
var normalizeWheelEventDelta = uiUtilsLib.normalizeWheelEventDelta;
var animationStarted = uiUtilsLib.animationStarted;
var localized = uiUtilsLib.localized;
var RendererType = uiUtilsLib.RendererType;
import {
animationStarted, DEFAULT_SCALE_VALUE, getPDFFileNameFromURL, localized,
MAX_SCALE, MIN_SCALE, mozL10n, noContextMenuHandler, normalizeWheelEventDelta,
parseQueryString, ProgressBar, RendererType, UNKNOWN_SCALE
} from 'pdfjs-web/ui_utils';
import {
build, createBlob, getDocument, getFilenameFromUrl, InvalidPDFException,
MissingPDFException, OPS, PDFJS, shadow, UnexpectedResponseException,
UNSUPPORTED_FEATURES, version,
} from 'pdfjs-web/pdfjs';
import {
PDFRenderingQueue, RenderingStates
} from 'pdfjs-web/pdf_rendering_queue';
import { PDFSidebar, SidebarView } from 'pdfjs-web/pdf_sidebar';
import { PDFViewer, PresentationModeState } from 'pdfjs-web/pdf_viewer';
import { getGlobalEventBus } from 'pdfjs-web/dom_events';
import { HandTool } from 'pdfjs-web/hand_tool';
import { OverlayManager } from 'pdfjs-web/overlay_manager';
import { PasswordPrompt } from 'pdfjs-web/password_prompt';
import { PDFAttachmentViewer } from 'pdfjs-web/pdf_attachment_viewer';
import { PDFDocumentProperties } from 'pdfjs-web/pdf_document_properties';
import { PDFFindBar } from 'pdfjs-web/pdf_find_bar';
import { PDFFindController } from 'pdfjs-web/pdf_find_controller';
import { PDFHistory } from 'pdfjs-web/pdf_history';
import { PDFLinkService } from 'pdfjs-web/pdf_link_service';
import { PDFOutlineViewer } from 'pdfjs-web/pdf_outline_viewer';
import { PDFPresentationMode } from 'pdfjs-web/pdf_presentation_mode';
import { PDFThumbnailViewer } from 'pdfjs-web/pdf_thumbnail_viewer';
import { Preferences } from 'pdfjs-web/preferences';
import { SecondaryToolbar } from 'pdfjs-web/secondary_toolbar';
import { Toolbar } from 'pdfjs-web/toolbar';
import { ViewHistory } from 'pdfjs-web/view_history';
var DEFAULT_SCALE_DELTA = 1.1;
var DISABLE_AUTO_FETCH_LOADING_BAR_TIMEOUT = 5000;
@ -124,13 +67,13 @@ function configure(PDFJS) {
}
}
var DefaultExernalServices = {
var DefaultExternalServices = {
updateFindControlState: function (data) {},
initPassiveLoading: function (callbacks) {},
fallback: function (data, callback) {},
reportTelemetry: function (data) {},
createDownloadManager: function () {
return new downloadManagerLib.DownloadManager();
throw new Error('Not implemented: createDownloadManager');
},
supportsIntegratedFind: false,
supportsDocumentFonts: true,
@ -196,12 +139,11 @@ var PDFViewerApplication = {
isViewerEmbedded: (window.parent !== window),
url: '',
baseUrl: '',
externalServices: DefaultExernalServices,
externalServices: DefaultExternalServices,
// called once when the document is loaded
initialize: function pdfViewInitialize(appConfig) {
var self = this;
var PDFJS = pdfjsLib.PDFJS;
Preferences.initialize();
this.preferences = Preferences;
@ -240,7 +182,6 @@ var PDFViewerApplication = {
*/
_readPreferences: function () {
var self = this;
var PDFJS = pdfjsLib.PDFJS;
return Promise.all([
Preferences.get('enableWebGL').then(function resolved(value) {
@ -506,11 +447,11 @@ var PDFViewerApplication = {
support = false;
}
}
if (support && pdfjsLib.PDFJS.disableFullscreen === true) {
if (support && PDFJS.disableFullscreen === true) {
support = false;
}
return pdfjsLib.shadow(this, 'supportsFullscreen', support);
return shadow(this, 'supportsFullscreen', support);
},
get supportsIntegratedFind() {
@ -528,7 +469,7 @@ var PDFViewerApplication = {
get loadingBar() {
var bar = new ProgressBar('#loadingBar', {});
return pdfjsLib.shadow(this, 'loadingBar', bar);
return shadow(this, 'loadingBar', bar);
},
get supportedMouseWheelZoomModifierKeys() {
@ -578,7 +519,7 @@ var PDFViewerApplication = {
var title = getPDFFileNameFromURL(url, '');
if (!title) {
try {
title = decodeURIComponent(pdfjsLib.getFilenameFromUrl(url)) || url;
title = decodeURIComponent(getFilenameFromUrl(url)) || url;
} catch (e) {
// decodeURIComponent may throw URIError,
// fall back to using the unprocessed url in that case
@ -693,7 +634,7 @@ var PDFViewerApplication = {
var self = this;
self.downloadComplete = false;
var loadingTask = pdfjsLib.getDocument(parameters);
var loadingTask = getDocument(parameters);
this.pdfLoadingTask = loadingTask;
loadingTask.onPassword = function passwordNeeded(updateCallback, reason) {
@ -717,15 +658,15 @@ var PDFViewerApplication = {
var loadingErrorMessage = mozL10n.get('loading_error', null,
'An error occurred while loading the PDF.');
if (exception instanceof pdfjsLib.InvalidPDFException) {
if (exception instanceof InvalidPDFException) {
// change error message also for other builds
loadingErrorMessage = mozL10n.get('invalid_file_error', null,
'Invalid or corrupted PDF file.');
} else if (exception instanceof pdfjsLib.MissingPDFException) {
} else if (exception instanceof MissingPDFException) {
// special message for missing PDF's
loadingErrorMessage = mozL10n.get('missing_file_error', null,
'Missing PDF file.');
} else if (exception instanceof pdfjsLib.UnexpectedResponseException) {
} else if (exception instanceof UnexpectedResponseException) {
loadingErrorMessage = mozL10n.get('unexpected_response_error', null,
'Unexpected server response.');
}
@ -768,7 +709,7 @@ var PDFViewerApplication = {
this.pdfDocument.getData().then(
function getDataSuccess(data) {
var blob = pdfjsLib.createBlob(data, 'application/pdf');
var blob = createBlob(data, 'application/pdf');
downloadManager.download(blob, url, filename);
},
downloadByUrl // Error occurred try downloading with just the url.
@ -805,7 +746,7 @@ var PDFViewerApplication = {
*/
error: function pdfViewError(message, moreInfo) {
var moreInfoText = mozL10n.get('error_version_info',
{version: pdfjsLib.version || '?', build: pdfjsLib.build || '?'},
{version: version || '?', build: build || '?'},
'PDF.js v{{version}} (build: {{build}})') + '\n';
if (moreInfo) {
moreInfoText +=
@ -883,7 +824,7 @@ var PDFViewerApplication = {
// the loading bar will not be completely filled, nor will it be hidden.
// To prevent displaying a partially filled loading bar permanently, we
// hide it when no data has been loaded during a certain amount of time.
if (pdfjsLib.PDFJS.disableAutoFetch && percent) {
if (PDFJS.disableAutoFetch && percent) {
if (this.disableAutoFetchLoadingBarTimeout) {
clearTimeout(this.disableAutoFetchLoadingBarTimeout);
this.disableAutoFetchLoadingBarTimeout = null;
@ -946,7 +887,7 @@ var PDFViewerApplication = {
self.loadingBar.setWidth(self.appConfig.viewerContainer);
if (!pdfjsLib.PDFJS.disableHistory && !self.isViewerEmbedded) {
if (!PDFJS.disableHistory && !self.isViewerEmbedded) {
// The browsing history is only enabled when the viewer is standalone,
// i.e. not when it is embedded in a web page.
if (!self.viewerPrefs['showPreviousViewOnLoad']) {
@ -1050,7 +991,7 @@ var PDFViewerApplication = {
pdfDocument.getJavaScript().then(function(javaScript) {
if (javaScript.length) {
console.warn('Warning: JavaScript is not supported');
self.fallback(pdfjsLib.UNSUPPORTED_FEATURES.javaScript);
self.fallback(UNSUPPORTED_FEATURES.javaScript);
}
// Hack to support auto printing.
var regex = /\bprint\s*\(/;
@ -1085,8 +1026,8 @@ var PDFViewerApplication = {
console.log('PDF ' + pdfDocument.fingerprint + ' [' +
info.PDFFormatVersion + ' ' + (info.Producer || '-').trim() +
' / ' + (info.Creator || '-').trim() + ']' +
' (PDF.js: ' + (pdfjsLib.version || '-') +
(!pdfjsLib.PDFJS.disableWebGL ? ' [WebGL]' : '') + ')');
' (PDF.js: ' + (version || '-') +
(!PDFJS.disableWebGL ? ' [WebGL]' : '') + ')');
var pdfTitle;
if (metadata && metadata.has('dc:title')) {
@ -1107,7 +1048,7 @@ var PDFViewerApplication = {
if (info.IsAcroFormPresent) {
console.warn('Warning: AcroForm/XFA is not supported');
self.fallback(pdfjsLib.UNSUPPORTED_FEATURES.forms);
self.fallback(UNSUPPORTED_FEATURES.forms);
}
if (typeof PDFJSDev !== 'undefined' &&
@ -1390,7 +1331,10 @@ function loadAndEnablePDFBug(enabledTabs) {
script.src = appConfig.debuggerScriptPath;
script.onload = function () {
PDFBug.enable(enabledTabs);
PDFBug.init(pdfjsLib, appConfig.mainContainer);
PDFBug.init({
PDFJS,
OPS,
}, appConfig.mainContainer);
resolve();
};
script.onerror = function () {
@ -1436,8 +1380,6 @@ function webViewerInitialized() {
appConfig.secondaryToolbar.openFileButton.setAttribute('hidden', 'true');
}
var PDFJS = pdfjsLib.PDFJS;
if ((typeof PDFJSDev === 'undefined' || !PDFJSDev.test('PRODUCTION')) ||
PDFViewerApplication.viewerPrefs['pdfBugEnabled']) {
// Special debugging flags in the hash section of the URL.
@ -1616,7 +1558,7 @@ function webViewerPageRendered(e) {
thumbnailView.setImage(pageView);
}
if (pdfjsLib.PDFJS.pdfBug && Stats.enabled && pageView.stats) {
if (PDFJS.pdfBug && Stats.enabled && pageView.stats) {
Stats.add(pageNumber, pageView.stats);
}
@ -1781,7 +1723,7 @@ if (typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC')) {
webViewerFileInputChange = function webViewerFileInputChange(e) {
var file = e.fileInput.files[0];
if (!pdfjsLib.PDFJS.disableCreateObjectURL &&
if (!PDFJS.disableCreateObjectURL &&
typeof URL !== 'undefined' && URL.createObjectURL) {
PDFViewerApplication.open(URL.createObjectURL(file));
} else {
@ -1904,7 +1846,7 @@ function webViewerPageChanging(e) {
}
// we need to update stats
if (pdfjsLib.PDFJS.pdfBug && Stats.enabled) {
if (PDFJS.pdfBug && Stats.enabled) {
var pageView = PDFViewerApplication.pdfViewer.getPageView(page - 1);
if (pageView.stats) {
Stats.add(page, pageView.stats);
@ -2269,7 +2211,8 @@ var PDFPrintServiceFactory = {
}
};
exports.PDFViewerApplication = PDFViewerApplication;
exports.DefaultExernalServices = DefaultExernalServices;
exports.PDFPrintServiceFactory = PDFPrintServiceFactory;
}));
export {
PDFViewerApplication,
DefaultExternalServices,
PDFPrintServiceFactory,
};

View File

@ -14,32 +14,16 @@
*/
/* globals chrome */
'use strict';
import { DefaultExternalServices, PDFViewerApplication } from 'pdfjs-web/app';
import { OverlayManager } from 'pdfjs-web/overlay_manager';
import { PDFJS } from 'pdfjs-web/pdfjs';
import { Preferences } from 'pdfjs-web/preferences';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs-web/chromecom', ['exports', 'pdfjs-web/app',
'pdfjs-web/overlay_manager', 'pdfjs-web/preferences', 'pdfjs-web/pdfjs'],
factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('./app.js'), require('./overlay_manager.js'),
require('./preferences.js'), require('./pdfjs.js'));
} else {
factory((root.pdfjsWebChromeCom = {}), root.pdfjsWebApp,
root.pdfjsWebOverlayManager, root.pdfjsWebPreferences,
root.pdfjsWebPDFJS);
}
}(this, function (exports, app, overlayManager, preferences, pdfjsLib) {
if (typeof PDFJSDev === 'undefined' || !PDFJSDev.test('CHROME')) {
throw new Error('Module "pdfjs-web/chromecom" shall not be used outside ' +
'CHROME build.');
}
var PDFViewerApplication = app.PDFViewerApplication;
var DefaultExernalServices = app.DefaultExernalServices;
var OverlayManager = overlayManager.OverlayManager;
var Preferences = preferences.Preferences;
var ChromeCom = {};
/**
* Creates an event that the extension is listening for and will
@ -79,7 +63,7 @@
file = file.replace(/^drive:/i,
'filesystem:' + location.origin + '/external/');
if (/^filesystem:/.test(file) && !pdfjsLib.PDFJS.disableWorker) {
if (/^filesystem:/.test(file) && !PDFJS.disableWorker) {
// The security origin of filesystem:-URLs are not preserved when the
// URL is passed to a Web worker, (http://crbug.com/362061), so we have
// to create an intermediate blob:-URL as a work-around.
@ -349,7 +333,7 @@
});
};
var ChromeExternalServices = Object.create(DefaultExernalServices);
var ChromeExternalServices = Object.create(DefaultExternalServices);
ChromeExternalServices.initPassiveLoading = function (callbacks) {
var appConfig = PDFViewerApplication.appConfig;
ChromeCom.resolvePDFFile(appConfig.defaultUrl,
@ -359,5 +343,6 @@
};
PDFViewerApplication.externalServices = ChromeExternalServices;
exports.ChromeCom = ChromeCom;
}));
export {
ChromeCom,
};

View File

@ -13,18 +13,7 @@
* limitations under the License.
*/
'use strict';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs-web/dom_events', ['exports', 'pdfjs-web/ui_utils'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('./ui_utils.js'));
} else {
factory((root.pdfjsWebDOMEvents = {}), root.pdfjsWebUIUtils);
}
}(this, function (exports, uiUtils) {
var EventBus = uiUtils.EventBus;
import { EventBus } from 'pdfjs-web/ui_utils';
// Attaching to the application event bus to dispatch events to the DOM for
// backwards viewer API compatibility.
@ -149,6 +138,7 @@
return globalEventBus;
}
exports.attachDOMEventsToEventBus = attachDOMEventsToEventBus;
exports.getGlobalEventBus = getGlobalEventBus;
}));
export {
attachDOMEventsToEventBus,
getGlobalEventBus,
};

View File

@ -13,20 +13,14 @@
* limitations under the License.
*/
'use strict';
import {
createObjectURL, createValidAbsoluteUrl, PDFJS
} from 'pdfjs-web/pdfjs';
import { DefaultExternalServices, PDFViewerApplication } from 'pdfjs-web/app';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs-web/download_manager', ['exports', 'pdfjs-web/pdfjs'],
factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('./pdfjs.js'));
} else {
factory((root.pdfjsWebDownloadManager = {}), root.pdfjsWebPDFJS);
}
}(this, function (exports, pdfjsLib) {
if (typeof PDFJSDev !== 'undefined' && PDFJSDev.test('FIREFOX || MOZCENTRAL')) {
return;
if (typeof PDFJSDev !== 'undefined' && !PDFJSDev.test('CHROME || GENERIC')) {
throw new Error('Module "pdfjs-web/download_manager" shall not be used ' +
'outside CHROME and GENERIC builds.');
}
function download(blobUrl, filename) {
@ -69,7 +63,7 @@ function DownloadManager() {}
DownloadManager.prototype = {
downloadUrl: function DownloadManager_downloadUrl(url, filename) {
if (!pdfjsLib.createValidAbsoluteUrl(url, 'http://example.com')) {
if (!createValidAbsoluteUrl(url, 'http://example.com')) {
return; // restricted/invalid URL
}
download(url + '#pdfjs.action=download', filename);
@ -82,8 +76,8 @@ DownloadManager.prototype = {
filename);
}
var blobUrl = pdfjsLib.createObjectURL(data, contentType,
pdfjsLib.PDFJS.disableCreateObjectURL);
var blobUrl = createObjectURL(data, contentType,
PDFJS.disableCreateObjectURL);
download(blobUrl, filename);
},
@ -96,7 +90,7 @@ DownloadManager.prototype = {
return;
}
if (pdfjsLib.PDFJS.disableCreateObjectURL) {
if (PDFJS.disableCreateObjectURL) {
// URL.createObjectURL is not supported
this.downloadUrl(url, filename);
return;
@ -107,5 +101,12 @@ DownloadManager.prototype = {
}
};
exports.DownloadManager = DownloadManager;
}));
var GenericExternalServices = Object.create(DefaultExternalServices);
GenericExternalServices.createDownloadManager = function () {
return new DownloadManager();
};
PDFViewerApplication.externalServices = GenericExternalServices;
export {
DownloadManager,
};

View File

@ -13,22 +13,9 @@
* limitations under the License.
*/
'use strict';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs-web/firefox_print_service', ['exports', 'pdfjs-web/ui_utils',
'pdfjs-web/app', 'pdfjs-web/pdfjs'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('./ui_utils.js'), require('./app.js'),
require('./pdfjs.js'));
} else {
factory((root.pdfjsWebFirefoxPrintService = {}), root.pdfjsWebUIUtils,
root.pdfjsWebApp, root.pdfjsWebPDFJS);
}
}(this, function (exports, uiUtils, app, pdfjsLib) {
var CSS_UNITS = uiUtils.CSS_UNITS;
var PDFPrintServiceFactory = app.PDFPrintServiceFactory;
import { CSS_UNITS } from 'pdfjs-web/ui_utils';
import { PDFPrintServiceFactory } from 'pdfjs-web/app';
import { shadow } from 'pdfjs-web/pdfjs';
// Creates a placeholder with div and canvas with right size for the page.
function composePage(pdfDocument, pageNumber, size, printContainer) {
@ -109,7 +96,7 @@
var canvas = document.createElement('canvas');
var value = 'mozPrintCallback' in canvas;
return pdfjsLib.shadow(this, 'supportsPrinting', value);
return shadow(this, 'supportsPrinting', value);
},
createPrintService: function (pdfDocument, pagesOverview, printContainer) {
@ -118,5 +105,6 @@
}
};
exports.FirefoxPrintService = FirefoxPrintService;
}));
export {
FirefoxPrintService,
};

View File

@ -13,29 +13,18 @@
* limitations under the License.
*/
'use strict';
import {
createObjectURL, PDFDataRangeTransport, shadow
} from 'pdfjs-web/pdfjs';
import { PDFViewerApplication } from 'pdfjs-web/app';
import { Preferences } from 'pdfjs-web/preferences';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs-web/firefoxcom', ['exports', 'pdfjs-web/preferences',
'pdfjs-web/app', 'pdfjs-web/pdfjs'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('./preferences.js'), require('./app.js'),
require('./pdfjs.js'));
} else {
factory((root.pdfjsWebFirefoxCom = {}), root.pdfjsWebPreferences,
root.pdfjsWebApp, root.pdfjsWebPDFJS);
}
}(this, function (exports, preferences, app, pdfjsLib) {
if (typeof PDFJSDev === 'undefined' ||
!PDFJSDev.test('FIREFOX || MOZCENTRAL')) {
throw new Error('Module "pdfjs-web/firefoxcom" shall not be used outside ' +
'FIREFOX and MOZCENTRAL builds.');
}
var Preferences = preferences.Preferences;
var PDFViewerApplication = app.PDFViewerApplication;
var FirefoxCom = (function FirefoxComClosure() {
return {
/**
@ -107,7 +96,7 @@ var DownloadManager = (function DownloadManagerClosure() {
downloadData: function DownloadManager_downloadData(data, filename,
contentType) {
var blobUrl = pdfjsLib.createObjectURL(data, contentType, false);
var blobUrl = createObjectURL(data, contentType, false);
FirefoxCom.request('download', {
blobUrl: blobUrl,
@ -181,10 +170,10 @@ Preferences._readFromStorage = function (prefObj) {
})();
function FirefoxComDataRangeTransport(length, initialData) {
pdfjsLib.PDFDataRangeTransport.call(this, length, initialData);
PDFDataRangeTransport.call(this, length, initialData);
}
FirefoxComDataRangeTransport.prototype =
Object.create(pdfjsLib.PDFDataRangeTransport.prototype);
Object.create(PDFDataRangeTransport.prototype);
FirefoxComDataRangeTransport.prototype.requestDataRange =
function FirefoxComDataRangeTransport_requestDataRange(begin, end) {
FirefoxCom.request('requestDataRange', { begin: begin, end: end });
@ -260,23 +249,22 @@ PDFViewerApplication.externalServices = {
get supportsIntegratedFind() {
var support = FirefoxCom.requestSync('supportsIntegratedFind');
return pdfjsLib.shadow(this, 'supportsIntegratedFind', support);
return shadow(this, 'supportsIntegratedFind', support);
},
get supportsDocumentFonts() {
var support = FirefoxCom.requestSync('supportsDocumentFonts');
return pdfjsLib.shadow(this, 'supportsDocumentFonts', support);
return shadow(this, 'supportsDocumentFonts', support);
},
get supportsDocumentColors() {
var support = FirefoxCom.requestSync('supportsDocumentColors');
return pdfjsLib.shadow(this, 'supportsDocumentColors', support);
return shadow(this, 'supportsDocumentColors', support);
},
get supportedMouseWheelZoomModifierKeys() {
var support = FirefoxCom.requestSync('supportedMouseWheelZoomModifierKeys');
return pdfjsLib.shadow(this, 'supportedMouseWheelZoomModifierKeys',
support);
return shadow(this, 'supportedMouseWheelZoomModifierKeys', support);
},
};
@ -291,6 +279,7 @@ document.mozL10n.setExternalLocalizerServices({
}
});
exports.DownloadManager = DownloadManager;
exports.FirefoxCom = FirefoxCom;
}));
export {
DownloadManager,
FirefoxCom,
};

View File

@ -14,17 +14,6 @@
* limitations under the License.
*/
'use strict';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs-web/grab_to_pan', ['exports'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports);
} else {
factory((root.pdfjsWebGrabToPan = {}));
}
}(this, function (exports) {
/**
* Construct a GrabToPan instance for a given HTML element.
* @param options.element {Element}
@ -233,5 +222,6 @@
}
}
exports.GrabToPan = GrabToPan;
}));
export {
GrabToPan,
};

View File

@ -13,24 +13,9 @@
* limitations under the License.
*/
'use strict';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs-web/hand_tool', ['exports', 'pdfjs-web/grab_to_pan',
'pdfjs-web/preferences', 'pdfjs-web/ui_utils'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('./grab_to_pan.js'), require('./preferences.js'),
require('./ui_utils.js'));
} else {
factory((root.pdfjsWebHandTool = {}), root.pdfjsWebGrabToPan,
root.pdfjsWebPreferences, root.pdfjsWebUIUtils);
}
}(this, function (exports, grabToPan, preferences, uiUtils) {
var GrabToPan = grabToPan.GrabToPan;
var Preferences = preferences.Preferences;
var localized = uiUtils.localized;
import { GrabToPan } from 'pdfjs-web/grab_to_pan';
import { localized } from 'pdfjs-web/ui_utils';
import { Preferences } from 'pdfjs-web/preferences';
/**
* @typedef {Object} HandToolOptions
@ -110,5 +95,6 @@ var HandTool = (function HandToolClosure() {
return HandTool;
})();
exports.HandTool = HandTool;
}));
export {
HandTool,
};

View File

@ -13,18 +13,6 @@
* limitations under the License.
*/
'use strict';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs-web/overlay_manager', ['exports'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports);
} else {
factory((root.pdfjsWebOverlayManager = {}));
}
}(this, function (exports) {
var OverlayManager = {
overlays: {},
active: null,
@ -151,5 +139,6 @@ var OverlayManager = {
}
};
exports.OverlayManager = OverlayManager;
}));
export {
OverlayManager,
};

View File

@ -13,24 +13,9 @@
* limitations under the License.
*/
'use strict';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs-web/password_prompt', ['exports',
'pdfjs-web/ui_utils', 'pdfjs-web/overlay_manager', 'pdfjs-web/pdfjs'],
factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('./ui_utils.js'), require('./overlay_manager.js'),
require('./pdfjs.js'));
} else {
factory((root.pdfjsWebPasswordPrompt = {}), root.pdfjsWebUIUtils,
root.pdfjsWebOverlayManager, root.pdfjsWebPDFJS);
}
}(this, function (exports, uiUtils, overlayManager, pdfjsLib) {
var mozL10n = uiUtils.mozL10n;
var OverlayManager = overlayManager.OverlayManager;
import { mozL10n } from 'pdfjs-web/ui_utils';
import { OverlayManager } from 'pdfjs-web/overlay_manager';
import { PasswordResponses } from 'pdfjs-web/pdfjs';
/**
* @typedef {Object} PasswordPromptOptions
@ -86,7 +71,7 @@ var PasswordPrompt = (function PasswordPromptClosure() {
var promptString = mozL10n.get('password_label', null,
'Enter the password to open this PDF file.');
if (this.reason === pdfjsLib.PasswordResponses.INCORRECT_PASSWORD) {
if (this.reason === PasswordResponses.INCORRECT_PASSWORD) {
promptString = mozL10n.get('password_invalid', null,
'Invalid password. Please try again.');
}
@ -120,5 +105,6 @@ var PasswordPrompt = (function PasswordPromptClosure() {
return PasswordPrompt;
})();
exports.PasswordPrompt = PasswordPrompt;
}));
export {
PasswordPrompt,
};

View File

@ -13,18 +13,10 @@
* limitations under the License.
*/
'use strict';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs-web/pdf_attachment_viewer', ['exports', 'pdfjs-web/pdfjs'],
factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('./pdfjs.js'));
} else {
factory((root.pdfjsWebPDFAttachmentViewer = {}), root.pdfjsWebPDFJS);
}
}(this, function (exports, pdfjsLib) {
import {
createObjectURL, createPromiseCapability, getFilenameFromUrl, PDFJS,
removeNullCharacters
} from 'pdfjs-web/pdfjs';
/**
* @typedef {Object} PDFAttachmentViewerOptions
@ -52,7 +44,7 @@ var PDFAttachmentViewer = (function PDFAttachmentViewerClosure() {
this.eventBus = options.eventBus;
this.downloadManager = options.downloadManager;
this._renderedCapability = pdfjsLib.createPromiseCapability();
this._renderedCapability = createPromiseCapability();
this.eventBus.on('fileattachmentannotation',
this._appendAttachment.bind(this));
}
@ -67,7 +59,7 @@ var PDFAttachmentViewer = (function PDFAttachmentViewerClosure() {
if (!keepRenderedCapability) {
// NOTE: The *only* situation in which the `_renderedCapability` should
// not be replaced is when appending file attachment annotations.
this._renderedCapability = pdfjsLib.createPromiseCapability();
this._renderedCapability = createPromiseCapability();
}
},
@ -92,8 +84,8 @@ var PDFAttachmentViewer = (function PDFAttachmentViewerClosure() {
var blobUrl;
button.onclick = function() {
if (!blobUrl) {
blobUrl = pdfjsLib.createObjectURL(
content, 'application/pdf', pdfjsLib.PDFJS.disableCreateObjectURL);
blobUrl = createObjectURL(
content, 'application/pdf', PDFJS.disableCreateObjectURL);
}
var viewerUrl;
if (typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC')) {
@ -153,8 +145,7 @@ var PDFAttachmentViewer = (function PDFAttachmentViewerClosure() {
for (var i = 0; i < attachmentsCount; i++) {
var item = attachments[names[i]];
var filename = pdfjsLib.getFilenameFromUrl(item.filename);
filename = pdfjsLib.removeNullCharacters(filename);
var filename = removeNullCharacters(getFilenameFromUrl(item.filename));
var div = document.createElement('div');
div.className = 'attachmentsItem';
@ -205,5 +196,6 @@ var PDFAttachmentViewer = (function PDFAttachmentViewerClosure() {
return PDFAttachmentViewer;
})();
exports.PDFAttachmentViewer = PDFAttachmentViewer;
}));
export {
PDFAttachmentViewer,
};

View File

@ -13,23 +13,8 @@
* limitations under the License.
*/
'use strict';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs-web/pdf_document_properties', ['exports',
'pdfjs-web/ui_utils', 'pdfjs-web/overlay_manager'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('./ui_utils.js'), require('./overlay_manager.js'));
} else {
factory((root.pdfjsWebPDFDocumentProperties = {}), root.pdfjsWebUIUtils,
root.pdfjsWebOverlayManager);
}
}(this, function (exports, uiUtils, overlayManager) {
var getPDFFileNameFromURL = uiUtils.getPDFFileNameFromURL;
var mozL10n = uiUtils.mozL10n;
var OverlayManager = overlayManager.OverlayManager;
import { getPDFFileNameFromURL, mozL10n } from 'pdfjs-web/ui_utils';
import { OverlayManager } from 'pdfjs-web/overlay_manager';
/**
* @typedef {Object} PDFDocumentPropertiesOptions
@ -239,5 +224,6 @@ var PDFDocumentProperties = (function PDFDocumentPropertiesClosure() {
return PDFDocumentProperties;
})();
exports.PDFDocumentProperties = PDFDocumentProperties;
}));
export {
PDFDocumentProperties,
};

View File

@ -13,23 +13,8 @@
* limitations under the License.
*/
'use strict';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs-web/pdf_find_bar', ['exports',
'pdfjs-web/ui_utils', 'pdfjs-web/pdf_find_controller'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('./ui_utils.js'),
require('./pdf_find_controller.js'));
} else {
factory((root.pdfjsWebPDFFindBar = {}), root.pdfjsWebUIUtils,
root.pdfjsWebPDFFindController);
}
}(this, function (exports, uiUtils, pdfFindController) {
var mozL10n = uiUtils.mozL10n;
var FindStates = pdfFindController.FindStates;
import { FindStates } from 'pdfjs-web/pdf_find_controller';
import { mozL10n } from 'pdfjs-web/ui_utils';
/**
* Creates a "search bar" given a set of DOM elements that act as controls
@ -236,5 +221,6 @@ var PDFFindBar = (function PDFFindBarClosure() {
return PDFFindBar;
})();
exports.PDFFindBar = PDFFindBar;
}));
export {
PDFFindBar,
};

View File

@ -13,20 +13,7 @@
* limitations under the License.
*/
'use strict';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs-web/pdf_find_controller', ['exports', 'pdfjs-web/ui_utils'],
factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('./ui_utils.js'));
} else {
factory((root.pdfjsWebPDFFindController = {}), root.pdfjsWebUIUtils);
}
}(this, function (exports, uiUtils) {
var scrollIntoView = uiUtils.scrollIntoView;
import { scrollIntoView } from 'pdfjs-web/ui_utils';
var FindStates = {
FIND_FOUND: 0,
@ -505,6 +492,7 @@ var PDFFindController = (function PDFFindControllerClosure() {
return PDFFindController;
})();
exports.FindStates = FindStates;
exports.PDFFindController = PDFFindController;
}));
export {
FindStates,
PDFFindController,
};

View File

@ -14,18 +14,7 @@
*/
/* globals chrome */
'use strict';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs-web/pdf_history', ['exports', 'pdfjs-web/dom_events'],
factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('./dom_events.js'));
} else {
factory((root.pdfjsWebPDFHistory = {}), root.pdfjsWebDOMEvents);
}
}(this, function (exports, domEvents) {
import { domEvents } from 'pdfjs-web/dom_events';
function PDFHistory(options) {
this.linkService = options.linkService;
@ -432,5 +421,6 @@
}
};
exports.PDFHistory = PDFHistory;
}));
export {
PDFHistory,
};

View File

@ -13,21 +13,8 @@
* limitations under the License.
*/
'use strict';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs-web/pdf_link_service', ['exports', 'pdfjs-web/ui_utils',
'pdfjs-web/dom_events'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('./ui_utils.js'), require('./dom_events.js'));
} else {
factory((root.pdfjsWebPDFLinkService = {}), root.pdfjsWebUIUtils,
root.pdfjsWebDOMEvents);
}
}(this, function (exports, uiUtils, domEvents) {
var parseQueryString = uiUtils.parseQueryString;
import { domEvents } from 'pdfjs-web/dom_events';
import { parseQueryString } from 'pdfjs-web/ui_utils';
var PageNumberRegExp = /^\d+$/;
function isPageNumber(str) {
@ -487,6 +474,7 @@ var SimpleLinkService = (function SimpleLinkServiceClosure() {
return SimpleLinkService;
})();
exports.PDFLinkService = PDFLinkService;
exports.SimpleLinkService = SimpleLinkService;
}));
export {
PDFLinkService,
SimpleLinkService,
};

View File

@ -13,20 +13,9 @@
* limitations under the License.
*/
'use strict';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs-web/pdf_outline_viewer', ['exports', 'pdfjs-web/pdfjs'],
factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('./pdfjs.js'));
} else {
factory((root.pdfjsWebPDFOutlineViewer = {}), root.pdfjsWebPDFJS);
}
}(this, function (exports, pdfjsLib) {
var PDFJS = pdfjsLib.PDFJS;
import {
addLinkAttributes, PDFJS, removeNullCharacters
} from 'pdfjs-web/pdfjs';
var DEFAULT_TITLE = '\u2013';
@ -85,7 +74,7 @@ var PDFOutlineViewer = (function PDFOutlineViewerClosure() {
*/
_bindLink: function PDFOutlineViewer_bindLink(element, item) {
if (item.url) {
pdfjsLib.addLinkAttributes(element, {
addLinkAttributes(element, {
url: item.url,
target: (item.newWindow ? PDFJS.LinkTarget.BLANK : undefined),
});
@ -200,7 +189,7 @@ var PDFOutlineViewer = (function PDFOutlineViewerClosure() {
this._bindLink(element, item);
this._setStyles(element, item);
element.textContent =
pdfjsLib.removeNullCharacters(item.title) || DEFAULT_TITLE;
removeNullCharacters(item.title) || DEFAULT_TITLE;
div.appendChild(element);
@ -231,5 +220,6 @@ var PDFOutlineViewer = (function PDFOutlineViewerClosure() {
return PDFOutlineViewer;
})();
exports.PDFOutlineViewer = PDFOutlineViewer;
}));
export {
PDFOutlineViewer,
};

View File

@ -13,31 +13,15 @@
* limitations under the License.
*/
'use strict';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs-web/pdf_page_view', ['exports',
'pdfjs-web/ui_utils', 'pdfjs-web/pdf_rendering_queue',
'pdfjs-web/dom_events', 'pdfjs-web/pdfjs'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('./ui_utils.js'),
require('./pdf_rendering_queue.js'), require('./dom_events.js'),
require('./pdfjs.js'));
} else {
factory((root.pdfjsWebPDFPageView = {}), root.pdfjsWebUIUtils,
root.pdfjsWebPDFRenderingQueue, root.pdfjsWebDOMEvents,
root.pdfjsWebPDFJS);
}
}(this, function (exports, uiUtils, pdfRenderingQueue, domEvents, pdfjsLib) {
var CSS_UNITS = uiUtils.CSS_UNITS;
var DEFAULT_SCALE = uiUtils.DEFAULT_SCALE;
var getOutputScale = uiUtils.getOutputScale;
var approximateFraction = uiUtils.approximateFraction;
var roundToDivide = uiUtils.roundToDivide;
var RendererType = uiUtils.RendererType;
var RenderingStates = pdfRenderingQueue.RenderingStates;
import {
approximateFraction, CSS_UNITS, DEFAULT_SCALE, getOutputScale, RendererType,
roundToDivide
} from 'pdfjs-web/ui_utils';
import {
CustomStyle, PDFJS, RenderingCancelledException, SVGGraphics
} from 'pdfjs-web/pdfjs';
import { domEvents } from 'pdfjs-web/dom_events';
import { RenderingStates } from 'pdfjs-web/pdf_rendering_queue';
var TEXT_LAYER_RENDER_DELAY = 200; // ms
@ -234,17 +218,17 @@ var PDFPageView = (function PDFPageViewClosure() {
}
var isScalingRestricted = false;
if (this.canvas && pdfjsLib.PDFJS.maxCanvasPixels > 0) {
if (this.canvas && PDFJS.maxCanvasPixels > 0) {
var outputScale = this.outputScale;
if (((Math.floor(this.viewport.width) * outputScale.sx) | 0) *
((Math.floor(this.viewport.height) * outputScale.sy) | 0) >
pdfjsLib.PDFJS.maxCanvasPixels) {
PDFJS.maxCanvasPixels) {
isScalingRestricted = true;
}
}
if (this.canvas) {
if (pdfjsLib.PDFJS.useOnlyCssZoom ||
if (PDFJS.useOnlyCssZoom ||
(this.hasRestrictedScaling && isScalingRestricted)) {
this.cssTransform(this.canvas, true);
@ -290,8 +274,6 @@ var PDFPageView = (function PDFPageViewClosure() {
},
cssTransform: function PDFPageView_transform(target, redrawAnnotations) {
var CustomStyle = pdfjsLib.CustomStyle;
// Scale target (canvas or svg), its wrapper, and page container.
var width = this.viewport.width;
var height = this.viewport.height;
@ -443,7 +425,7 @@ var PDFPageView = (function PDFPageViewClosure() {
if (((typeof PDFJSDev === 'undefined' ||
!PDFJSDev.test('PDFJS_NEXT')) && error === 'cancelled') ||
error instanceof pdfjsLib.RenderingCancelledException) {
error instanceof RenderingCancelledException) {
self.error = null;
return Promise.resolve(undefined);
}
@ -553,7 +535,7 @@ var PDFPageView = (function PDFPageViewClosure() {
var outputScale = getOutputScale(ctx);
this.outputScale = outputScale;
if (pdfjsLib.PDFJS.useOnlyCssZoom) {
if (PDFJS.useOnlyCssZoom) {
var actualSizeViewport = viewport.clone({scale: CSS_UNITS});
// Use a scale that will make the canvas be the original intended size
// of the page.
@ -562,10 +544,9 @@ var PDFPageView = (function PDFPageViewClosure() {
outputScale.scaled = true;
}
if (pdfjsLib.PDFJS.maxCanvasPixels > 0) {
if (PDFJS.maxCanvasPixels > 0) {
var pixelsInViewport = viewport.width * viewport.height;
var maxScale =
Math.sqrt(pdfjsLib.PDFJS.maxCanvasPixels / pixelsInViewport);
var maxScale = Math.sqrt(PDFJS.maxCanvasPixels / pixelsInViewport);
if (outputScale.sx > maxScale || outputScale.sy > maxScale) {
outputScale.sx = maxScale;
outputScale.sy = maxScale;
@ -635,8 +616,8 @@ var PDFPageView = (function PDFPageViewClosure() {
var ensureNotCancelled = function () {
if (cancelled) {
if ((typeof PDFJSDev !== 'undefined' &&
PDFJSDev.test('PDFJS_NEXT')) || pdfjsLib.PDFJS.pdfjsNext) {
throw new pdfjsLib.RenderingCancelledException(
PDFJSDev.test('PDFJS_NEXT')) || PDFJS.pdfjsNext) {
throw new RenderingCancelledException(
'Rendering cancelled, page ' + self.id, 'svg');
} else {
throw 'cancelled'; // eslint-disable-line no-throw-literal
@ -646,7 +627,6 @@ var PDFPageView = (function PDFPageViewClosure() {
var self = this;
var pdfPage = this.pdfPage;
var SVGGraphics = pdfjsLib.SVGGraphics;
var actualSizeViewport = this.viewport.clone({scale: CSS_UNITS});
var promise = pdfPage.getOperatorList().then(function (opList) {
ensureNotCancelled();
@ -691,5 +671,6 @@ var PDFPageView = (function PDFPageViewClosure() {
return PDFPageView;
})();
exports.PDFPageView = PDFPageView;
}));
export {
PDFPageView,
};

View File

@ -13,19 +13,7 @@
* limitations under the License.
*/
'use strict';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs-web/pdf_presentation_mode', ['exports', 'pdfjs-web/ui_utils'],
factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('./ui_utils.js'));
} else {
factory((root.pdfjsWebPDFPresentationMode = {}), root.pdfjsWebUIUtils);
}
}(this, function (exports, uiUtils) {
var normalizeWheelEventDelta = uiUtils.normalizeWheelEventDelta;
import { normalizeWheelEventDelta } from 'pdfjs-web/ui_utils';
var DELAY_BEFORE_RESETTING_SWITCH_IN_PROGRESS = 1500; // in ms
var DELAY_BEFORE_HIDING_CONTROLS = 3000; // in ms
@ -517,5 +505,6 @@ var PDFPresentationMode = (function PDFPresentationModeClosure() {
return PDFPresentationMode;
})();
exports.PDFPresentationMode = PDFPresentationMode;
}));
export {
PDFPresentationMode,
};

View File

@ -13,25 +13,10 @@
* limitations under the License.
*/
'use strict';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs-web/pdf_print_service', ['exports', 'pdfjs-web/ui_utils',
'pdfjs-web/overlay_manager', 'pdfjs-web/app', 'pdfjs-web/pdfjs'],
factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('./ui_utils.js'), require('./overlay_manager.js'),
require('./app.js'), require('./pdfjs.js'));
} else {
factory((root.pdfjsWebPDFPrintService = {}), root.pdfjsWebUIUtils,
root.pdfjsWebOverlayManager, root.pdfjsWebApp, root.pdfjsWebPDFJS);
}
}(this, function (exports, uiUtils, overlayManager, app, pdfjsLib) {
var mozL10n = uiUtils.mozL10n;
var CSS_UNITS = uiUtils.CSS_UNITS;
var PDFPrintServiceFactory = app.PDFPrintServiceFactory;
var OverlayManager = overlayManager.OverlayManager;
import { CSS_UNITS, mozL10n } from 'pdfjs-web/ui_utils';
import { OverlayManager } from 'pdfjs-web/overlay_manager';
import { PDFJS } from 'pdfjs-web/pdfjs';
import { PDFPrintServiceFactory } from 'pdfjs-web/app';
var activeService = null;
@ -167,8 +152,7 @@
img.style.height = printItem.height;
var scratchCanvas = this.scratchCanvas;
if (('toBlob' in scratchCanvas) &&
!pdfjsLib.PDFJS.disableCreateObjectURL) {
if (('toBlob' in scratchCanvas) && !PDFJS.disableCreateObjectURL) {
scratchCanvas.toBlob(function (blob) {
img.src = URL.createObjectURL(blob);
});
@ -346,5 +330,6 @@
}
};
exports.PDFPrintService = PDFPrintService;
}));
export {
PDFPrintService,
};

View File

@ -13,18 +13,6 @@
* limitations under the License.
*/
'use strict';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs-web/pdf_rendering_queue', ['exports'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports);
} else {
factory((root.pdfjsWebPDFRenderingQueue = {}));
}
}(this, function (exports) {
var CLEANUP_TIMEOUT = 30000;
var RenderingStates = {
@ -186,6 +174,7 @@ var PDFRenderingQueue = (function PDFRenderingQueueClosure() {
return PDFRenderingQueue;
})();
exports.RenderingStates = RenderingStates;
exports.PDFRenderingQueue = PDFRenderingQueue;
}));
export {
RenderingStates,
PDFRenderingQueue,
};

View File

@ -13,23 +13,8 @@
* limitations under the License.
*/
'use strict';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs-web/pdf_sidebar', ['exports',
'pdfjs-web/pdf_rendering_queue', 'pdfjs-web/ui_utils'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('./pdf_rendering_queue.js'),
require('./ui_utils.js'));
} else {
factory((root.pdfjsWebPDFSidebar = {}), root.pdfjsWebPDFRenderingQueue,
root.pdfjsWebUIUtils);
}
}(this, function (exports, pdfRenderingQueue, uiUtils) {
var RenderingStates = pdfRenderingQueue.RenderingStates;
var mozL10n = uiUtils.mozL10n;
import { mozL10n } from 'pdfjs-web/ui_utils';
import { RenderingStates } from 'pdfjs-web/pdf_rendering_queue';
var UI_NOTIFICATION_CLASS = 'pdfSidebarNotification';
@ -460,6 +445,7 @@ var PDFSidebar = (function PDFSidebarClosure() {
return PDFSidebar;
})();
exports.SidebarView = SidebarView;
exports.PDFSidebar = PDFSidebar;
}));
export {
SidebarView,
PDFSidebar,
};

View File

@ -13,24 +13,8 @@
* limitations under the License.
*/
'use strict';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs-web/pdf_thumbnail_view', ['exports',
'pdfjs-web/ui_utils', 'pdfjs-web/pdf_rendering_queue'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('./ui_utils.js'),
require('./pdf_rendering_queue.js'));
} else {
factory((root.pdfjsWebPDFThumbnailView = {}), root.pdfjsWebUIUtils,
root.pdfjsWebPDFRenderingQueue);
}
}(this, function (exports, uiUtils, pdfRenderingQueue) {
var mozL10n = uiUtils.mozL10n;
var getOutputScale = uiUtils.getOutputScale;
var RenderingStates = pdfRenderingQueue.RenderingStates;
import { getOutputScale, mozL10n } from 'pdfjs-web/ui_utils';
import { RenderingStates } from 'pdfjs-web/pdf_rendering_queue';
var THUMBNAIL_WIDTH = 98; // px
var THUMBNAIL_CANVAS_BORDER_WIDTH = 1; // px
@ -430,5 +414,6 @@ var PDFThumbnailView = (function PDFThumbnailViewClosure() {
PDFThumbnailView.tempImageCache = null;
exports.PDFThumbnailView = PDFThumbnailView;
}));
export {
PDFThumbnailView,
};

View File

@ -13,25 +13,10 @@
* limitations under the License.
*/
'use strict';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs-web/pdf_thumbnail_viewer', ['exports',
'pdfjs-web/ui_utils', 'pdfjs-web/pdf_thumbnail_view'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('./ui_utils.js'),
require('./pdf_thumbnail_view.js'));
} else {
factory((root.pdfjsWebPDFThumbnailViewer = {}), root.pdfjsWebUIUtils,
root.pdfjsWebPDFThumbnailView);
}
}(this, function (exports, uiUtils, pdfThumbnailView) {
var watchScroll = uiUtils.watchScroll;
var getVisibleElements = uiUtils.getVisibleElements;
var scrollIntoView = uiUtils.scrollIntoView;
var PDFThumbnailView = pdfThumbnailView.PDFThumbnailView;
import {
getVisibleElements, scrollIntoView, watchScroll
} from 'pdfjs-web/ui_utils';
import { PDFThumbnailView } from 'pdfjs-web/pdf_thumbnail_view';
var THUMBNAIL_SCROLL_MARGIN = -19;
@ -247,5 +232,6 @@ var PDFThumbnailViewer = (function PDFThumbnailViewerClosure() {
return PDFThumbnailViewer;
})();
exports.PDFThumbnailViewer = PDFThumbnailViewer;
}));
export {
PDFThumbnailViewer,
};

View File

@ -13,48 +13,20 @@
* limitations under the License.
*/
'use strict';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs-web/pdf_viewer', ['exports', 'pdfjs-web/ui_utils',
'pdfjs-web/pdf_page_view', 'pdfjs-web/pdf_rendering_queue',
'pdfjs-web/text_layer_builder', 'pdfjs-web/annotation_layer_builder',
'pdfjs-web/pdf_link_service', 'pdfjs-web/dom_events', 'pdfjs-web/pdfjs'],
factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('./ui_utils.js'), require('./pdf_page_view.js'),
require('./pdf_rendering_queue.js'), require('./text_layer_builder.js'),
require('./annotation_layer_builder.js'),
require('./pdf_link_service.js'), require('./dom_events.js'),
require('./pdfjs.js'));
} else {
factory((root.pdfjsWebPDFViewer = {}), root.pdfjsWebUIUtils,
root.pdfjsWebPDFPageView, root.pdfjsWebPDFRenderingQueue,
root.pdfjsWebTextLayerBuilder, root.pdfjsWebAnnotationLayerBuilder,
root.pdfjsWebPDFLinkService, root.pdfjsWebDOMEvents, root.pdfjsWebPDFJS);
}
}(this, function (exports, uiUtils, pdfPageView, pdfRenderingQueue,
textLayerBuilder, annotationLayerBuilder, pdfLinkService,
domEvents, pdfjsLib) {
var UNKNOWN_SCALE = uiUtils.UNKNOWN_SCALE;
var SCROLLBAR_PADDING = uiUtils.SCROLLBAR_PADDING;
var VERTICAL_PADDING = uiUtils.VERTICAL_PADDING;
var MAX_AUTO_SCALE = uiUtils.MAX_AUTO_SCALE;
var CSS_UNITS = uiUtils.CSS_UNITS;
var DEFAULT_SCALE = uiUtils.DEFAULT_SCALE;
var DEFAULT_SCALE_VALUE = uiUtils.DEFAULT_SCALE_VALUE;
var RendererType = uiUtils.RendererType;
var scrollIntoView = uiUtils.scrollIntoView;
var watchScroll = uiUtils.watchScroll;
var getVisibleElements = uiUtils.getVisibleElements;
var PDFPageView = pdfPageView.PDFPageView;
var RenderingStates = pdfRenderingQueue.RenderingStates;
var PDFRenderingQueue = pdfRenderingQueue.PDFRenderingQueue;
var TextLayerBuilder = textLayerBuilder.TextLayerBuilder;
var AnnotationLayerBuilder = annotationLayerBuilder.AnnotationLayerBuilder;
var SimpleLinkService = pdfLinkService.SimpleLinkService;
import {
CSS_UNITS, DEFAULT_SCALE, DEFAULT_SCALE_VALUE, getVisibleElements,
MAX_AUTO_SCALE, RendererType, SCROLLBAR_PADDING, scrollIntoView,
UNKNOWN_SCALE, VERTICAL_PADDING, watchScroll
} from 'pdfjs-web/ui_utils';
import {
PDFRenderingQueue, RenderingStates,
} from 'pdfjs-web/pdf_rendering_queue';
import { AnnotationLayerBuilder } from 'pdfjs-web/annotation_layer_builder';
import { domEvents } from 'pdfjs-web/dom_events';
import { PDFJS } from 'pdfjs-web/pdfjs';
import { PDFPageView } from 'pdfjs-web/pdf_page_view';
import { SimpleLinkService } from 'pdfjs-web/pdf_link_service';
import { TextLayerBuilder } from 'pdfjs-web/text_layer_builder';
var PresentationModeState = {
UNKNOWN: 0,
@ -390,7 +362,7 @@ var PDFViewer = (function pdfViewer() {
var viewport = pdfPage.getViewport(scale * CSS_UNITS);
for (var pageNum = 1; pageNum <= pagesCount; ++pageNum) {
var textLayerFactory = null;
if (!pdfjsLib.PDFJS.disableTextLayer) {
if (!PDFJS.disableTextLayer) {
textLayerFactory = this;
}
var pageView = new PDFPageView({
@ -416,7 +388,7 @@ var PDFViewer = (function pdfViewer() {
// starts to create the correct size canvas. Wait until one page is
// rendered so we don't tie up too many resources early on.
onePageRendered.then(function () {
if (!pdfjsLib.PDFJS.disableAutoFetch) {
if (!PDFJS.disableAutoFetch) {
var getPagesLeft = pagesCount;
for (var pageNum = 1; pageNum <= pagesCount; ++pageNum) {
pdfDocument.getPage(pageNum).then(function (pageNum, pdfPage) {
@ -528,7 +500,7 @@ var PDFViewer = (function pdfViewer() {
if (!noScroll) {
var page = this._currentPageNumber, dest;
if (this._location && !pdfjsLib.PDFJS.ignoreCurrentPositionOnZoom &&
if (this._location && !PDFJS.ignoreCurrentPositionOnZoom &&
!(this.isInPresentationMode || this.isChangingPresentationMode)) {
page = this._location.pageNumber;
dest = [null, { name: 'XYZ' }, this._location.left,
@ -988,6 +960,7 @@ var PDFViewer = (function pdfViewer() {
return PDFViewer;
})();
exports.PresentationModeState = PresentationModeState;
exports.PDFViewer = PDFViewer;
}));
export {
PresentationModeState,
PDFViewer,
};

View File

@ -13,18 +13,6 @@
* limitations under the License.
*/
'use strict';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs-web/preferences', ['exports'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports);
} else {
factory((root.pdfjsWebPreferences = {}));
}
}(this, function (exports) {
var defaultPreferences = null;
function getDefaultPreferences() {
if (!defaultPreferences) {
@ -221,5 +209,6 @@ if (typeof PDFJSDev === 'undefined' ||
};
}
exports.Preferences = Preferences;
}));
export {
Preferences,
};

View File

@ -13,21 +13,7 @@
* limitations under the License.
*/
'use strict';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs-web/secondary_toolbar', ['exports', 'pdfjs-web/ui_utils'],
factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('./ui_utils.js'));
} else {
factory((root.pdfjsWebSecondaryToolbar = {}), root.pdfjsWebUIUtils);
}
}(this, function (exports, uiUtils) {
var SCROLLBAR_PADDING = uiUtils.SCROLLBAR_PADDING;
var mozL10n = uiUtils.mozL10n;
import { mozL10n, SCROLLBAR_PADDING } from 'pdfjs-web/ui_utils';
/**
* @typedef {Object} SecondaryToolbarOptions
@ -241,5 +227,6 @@ var SecondaryToolbar = (function SecondaryToolbarClosure() {
return SecondaryToolbar;
})();
exports.SecondaryToolbar = SecondaryToolbar;
}));
export {
SecondaryToolbar,
};

View File

@ -13,19 +13,8 @@
* limitations under the License.
*/
'use strict';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs-web/text_layer_builder', ['exports', 'pdfjs-web/dom_events',
'pdfjs-web/pdfjs'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('./dom_events.js'), require('./pdfjs.js'));
} else {
factory((root.pdfjsWebTextLayerBuilder = {}), root.pdfjsWebDOMEvents,
root.pdfjsWebPDFJS);
}
}(this, function (exports, domEvents, pdfjsLib) {
import { domEvents } from 'pdfjs-web/dom_events';
import { renderTextLayer } from 'pdfjs-web/pdfjs';
var EXPAND_DIVS_TIMEOUT = 300; // ms
@ -97,7 +86,7 @@ var TextLayerBuilder = (function TextLayerBuilderClosure() {
this.textDivs = [];
var textLayerFrag = document.createDocumentFragment();
this.textLayerRenderTask = pdfjsLib.renderTextLayer({
this.textLayerRenderTask = renderTextLayer({
textContent: this.textContent,
container: textLayerFrag,
viewport: this.viewport,
@ -419,6 +408,7 @@ DefaultTextLayerFactory.prototype = {
}
};
exports.TextLayerBuilder = TextLayerBuilder;
exports.DefaultTextLayerFactory = DefaultTextLayerFactory;
}));
export {
TextLayerBuilder,
DefaultTextLayerFactory,
};

View File

@ -13,28 +13,10 @@
* limitations under the License.
*/
'use strict';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs-web/toolbar', ['exports', 'pdfjs-web/ui_utils'],
factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('./ui_utils.js'));
} else {
factory((root.pdfjsWebToolbar = {}), root.pdfjsWebUIUtils);
}
}(this, function (exports, uiUtils) {
var mozL10n = uiUtils.mozL10n;
var noContextMenuHandler = uiUtils.noContextMenuHandler;
var animationStarted = uiUtils.animationStarted;
var localized = uiUtils.localized;
var DEFAULT_SCALE_VALUE = uiUtils.DEFAULT_SCALE_VALUE;
var DEFAULT_SCALE = uiUtils.DEFAULT_SCALE;
var MIN_SCALE = uiUtils.MIN_SCALE;
var MAX_SCALE = uiUtils.MAX_SCALE;
import {
animationStarted, DEFAULT_SCALE, DEFAULT_SCALE_VALUE, localized, MAX_SCALE,
MIN_SCALE, mozL10n, noContextMenuHandler
} from 'pdfjs-web/ui_utils';
var PAGE_NUMBER_LOADING_INDICATOR = 'visiblePageIsLoading';
var SCALE_SELECT_CONTAINER_PADDING = 8;
@ -286,5 +268,6 @@ var Toolbar = (function ToolbarClosure() {
return Toolbar;
})();
exports.Toolbar = Toolbar;
}));
export {
Toolbar,
};

View File

@ -13,17 +13,7 @@
* limitations under the License.
*/
'use strict';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs-web/ui_utils', ['exports', 'pdfjs-web/pdfjs'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('./pdfjs.js'));
} else {
factory((root.pdfjsWebUIUtils = {}), root.pdfjsWebPDFJS);
}
}(this, function (exports, pdfjsLib) {
import { PDFJS } from 'pdfjs-web/pdfjs';
var CSS_UNITS = 96.0 / 72.0;
var DEFAULT_SCALE_VALUE = 'auto';
@ -42,8 +32,6 @@ var RendererType = {
var mozL10n = document.mozL10n || document.webL10n;
var PDFJS = pdfjsLib.PDFJS;
/**
* Disables fullscreen support, and by extension Presentation Mode,
* in browsers which support the fullscreen API.
@ -571,30 +559,31 @@ var ProgressBar = (function ProgressBarClosure() {
return ProgressBar;
})();
exports.CSS_UNITS = CSS_UNITS;
exports.DEFAULT_SCALE_VALUE = DEFAULT_SCALE_VALUE;
exports.DEFAULT_SCALE = DEFAULT_SCALE;
exports.MIN_SCALE = MIN_SCALE;
exports.MAX_SCALE = MAX_SCALE;
exports.UNKNOWN_SCALE = UNKNOWN_SCALE;
exports.MAX_AUTO_SCALE = MAX_AUTO_SCALE;
exports.SCROLLBAR_PADDING = SCROLLBAR_PADDING;
exports.VERTICAL_PADDING = VERTICAL_PADDING;
exports.RendererType = RendererType;
exports.mozL10n = mozL10n;
exports.EventBus = EventBus;
exports.ProgressBar = ProgressBar;
exports.getPDFFileNameFromURL = getPDFFileNameFromURL;
exports.noContextMenuHandler = noContextMenuHandler;
exports.parseQueryString = parseQueryString;
exports.getVisibleElements = getVisibleElements;
exports.roundToDivide = roundToDivide;
exports.approximateFraction = approximateFraction;
exports.getOutputScale = getOutputScale;
exports.scrollIntoView = scrollIntoView;
exports.watchScroll = watchScroll;
exports.binarySearchFirstItem = binarySearchFirstItem;
exports.normalizeWheelEventDelta = normalizeWheelEventDelta;
exports.animationStarted = animationStarted;
exports.localized = localized;
}));
export {
CSS_UNITS,
DEFAULT_SCALE_VALUE,
DEFAULT_SCALE,
MIN_SCALE,
MAX_SCALE,
UNKNOWN_SCALE,
MAX_AUTO_SCALE,
SCROLLBAR_PADDING,
VERTICAL_PADDING,
RendererType,
mozL10n,
EventBus,
ProgressBar,
getPDFFileNameFromURL,
noContextMenuHandler,
parseQueryString,
getVisibleElements,
roundToDivide,
approximateFraction,
getOutputScale,
scrollIntoView,
watchScroll,
binarySearchFirstItem,
normalizeWheelEventDelta,
animationStarted,
localized,
};

View File

@ -13,18 +13,6 @@
* limitations under the License.
*/
'use strict';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs-web/view_history', ['exports'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports);
} else {
factory((root.pdfjsWebViewHistory = {}));
}
}(this, function (exports) {
var DEFAULT_VIEW_HISTORY_CACHE_SIZE = 20;
/**
@ -142,5 +130,6 @@ var ViewHistory = (function ViewHistoryClosure() {
return ViewHistory;
})();
exports.ViewHistory = ViewHistory;
}));
export {
ViewHistory,
};

View File

@ -50,6 +50,7 @@ if (typeof PDFJSDev !== 'undefined' && PDFJSDev.test('CHROME')) {
}
if (typeof PDFJSDev !== 'undefined' && PDFJSDev.test('CHROME || GENERIC')) {
require('./pdf_print_service.js');
require('./download_manager.js');
}
function getViewerConfiguration() {
@ -172,7 +173,8 @@ function webViewerLoad() {
var config = getViewerConfiguration();
if (typeof PDFJSDev === 'undefined' || !PDFJSDev.test('PRODUCTION')) {
Promise.all([SystemJS.import('pdfjs-web/app'),
SystemJS.import('pdfjs-web/pdf_print_service')])
SystemJS.import('pdfjs-web/pdf_print_service'),
SystemJS.import('pdfjs-web/download_manager')])
.then(function (modules) {
var app = modules[0];
window.PDFViewerApplication = app.PDFViewerApplication;