2015-11-22 01:32:47 +09:00
|
|
|
/* Copyright 2015 Mozilla Foundation
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
2016-03-03 09:48:21 +09:00
|
|
|
/* globals pdfjsVersion, pdfjsBuild */
|
2015-11-22 01:32:47 +09:00
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
(function (root, factory) {
|
|
|
|
if (typeof define === 'function' && define.amd) {
|
2016-03-03 10:32:20 +09:00
|
|
|
define('pdfjs/display/global', ['exports', 'pdfjs/shared/util'], factory);
|
2015-11-22 01:32:47 +09:00
|
|
|
} else if (typeof exports !== 'undefined') {
|
2016-03-03 10:32:20 +09:00
|
|
|
factory(exports, require('../shared/util.js'));
|
2015-11-22 01:32:47 +09:00
|
|
|
} else {
|
2016-03-03 10:32:20 +09:00
|
|
|
factory((root.pdfjsDisplayGlobal = {}), root.pdfjsSharedUtil);
|
2015-11-22 01:32:47 +09:00
|
|
|
}
|
2016-03-03 09:48:21 +09:00
|
|
|
}(this, function (exports, sharedUtil) {
|
2015-11-22 01:32:47 +09:00
|
|
|
|
2016-03-03 09:48:21 +09:00
|
|
|
var globalScope = sharedUtil.globalScope;
|
2015-11-22 01:32:47 +09:00
|
|
|
|
|
|
|
var isWorker = (typeof window === 'undefined');
|
|
|
|
|
|
|
|
// The global PDFJS object exposes the API
|
|
|
|
// In production, it will be declared outside a global wrapper
|
|
|
|
// In development, it will be declared here
|
|
|
|
if (!globalScope.PDFJS) {
|
|
|
|
globalScope.PDFJS = {};
|
|
|
|
}
|
2016-03-03 09:48:21 +09:00
|
|
|
var PDFJS = globalScope.PDFJS;
|
2015-11-22 01:32:47 +09:00
|
|
|
|
2015-12-24 08:46:08 +09:00
|
|
|
if (typeof pdfjsVersion !== 'undefined') {
|
2016-03-03 09:48:21 +09:00
|
|
|
PDFJS.version = pdfjsVersion;
|
2015-12-24 08:46:08 +09:00
|
|
|
}
|
2016-03-03 09:48:21 +09:00
|
|
|
if (typeof pdfjsBuild !== 'undefined') {
|
|
|
|
PDFJS.build = pdfjsBuild;
|
|
|
|
}
|
|
|
|
|
|
|
|
PDFJS.pdfBug = false;
|
|
|
|
|
|
|
|
if (PDFJS.verbosity !== undefined) {
|
|
|
|
sharedUtil.setVerbosityLevel(PDFJS.verbosity);
|
2015-12-24 08:46:08 +09:00
|
|
|
}
|
2016-03-04 01:13:37 +09:00
|
|
|
delete PDFJS.verbosity;
|
|
|
|
Object.defineProperty(PDFJS, 'verbosity', {
|
|
|
|
get: function () { return sharedUtil.getVerbosityLevel(); },
|
|
|
|
set: function (level) { sharedUtil.setVerbosityLevel(level); },
|
|
|
|
enumerable: true,
|
|
|
|
configurable: true
|
|
|
|
});
|
2015-12-24 08:46:08 +09:00
|
|
|
|
2016-03-03 09:48:21 +09:00
|
|
|
PDFJS.VERBOSITY_LEVELS = sharedUtil.VERBOSITY_LEVELS;
|
|
|
|
PDFJS.OPS = sharedUtil.OPS;
|
|
|
|
PDFJS.UNSUPPORTED_FEATURES = sharedUtil.UNSUPPORTED_FEATURES;
|
|
|
|
PDFJS.isValidUrl = sharedUtil.isValidUrl;
|
|
|
|
PDFJS.shadow = sharedUtil.shadow;
|
|
|
|
PDFJS.createBlob = sharedUtil.createBlob;
|
|
|
|
PDFJS.createObjectURL = function PDFJS_createObjectURL(data, contentType) {
|
|
|
|
return sharedUtil.createObjectURL(data, contentType,
|
|
|
|
PDFJS.disableCreateObjectURL);
|
|
|
|
};
|
|
|
|
Object.defineProperty(PDFJS, 'isLittleEndian', {
|
|
|
|
configurable: true,
|
|
|
|
get: function PDFJS_isLittleEndian() {
|
|
|
|
var value = sharedUtil.isLittleEndian();
|
|
|
|
return sharedUtil.shadow(PDFJS, 'isLittleEndian', value);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
PDFJS.removeNullCharacters = sharedUtil.removeNullCharacters;
|
|
|
|
PDFJS.PasswordResponses = sharedUtil.PasswordResponses;
|
|
|
|
PDFJS.PasswordException = sharedUtil.PasswordException;
|
|
|
|
PDFJS.UnknownErrorException = sharedUtil.UnknownErrorException;
|
|
|
|
PDFJS.InvalidPDFException = sharedUtil.InvalidPDFException;
|
|
|
|
PDFJS.MissingPDFException = sharedUtil.MissingPDFException;
|
|
|
|
PDFJS.UnexpectedResponseException = sharedUtil.UnexpectedResponseException;
|
|
|
|
PDFJS.Util = sharedUtil.Util;
|
|
|
|
PDFJS.PageViewport = sharedUtil.PageViewport;
|
|
|
|
PDFJS.createPromiseCapability = sharedUtil.createPromiseCapability;
|
2015-11-22 01:32:47 +09:00
|
|
|
|
|
|
|
exports.globalScope = globalScope;
|
|
|
|
exports.isWorker = isWorker;
|
|
|
|
exports.PDFJS = globalScope.PDFJS;
|
|
|
|
}));
|