|
|
@ -13,34 +13,24 @@ |
|
|
|
* limitations under the License. |
|
|
|
* limitations under the License. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
'use strict'; |
|
|
|
import { |
|
|
|
|
|
|
|
_UnsupportedManager, getDocument, PDFDataRangeTransport, PDFWorker |
|
|
|
(function (root, factory) { |
|
|
|
} from './api'; |
|
|
|
if (typeof define === 'function' && define.amd) { |
|
|
|
import { |
|
|
|
define('pdfjs/display/global', ['exports', 'pdfjs/shared/util', |
|
|
|
addLinkAttributes, CustomStyle, DEFAULT_LINK_REL, getFilenameFromUrl, |
|
|
|
'pdfjs/display/dom_utils', 'pdfjs/display/api', |
|
|
|
isExternalLinkTargetSet, isValidUrl, LinkTarget |
|
|
|
'pdfjs/display/annotation_layer', 'pdfjs/display/text_layer', |
|
|
|
} from './dom_utils'; |
|
|
|
'pdfjs/display/metadata', 'pdfjs/display/svg'], factory); |
|
|
|
import { |
|
|
|
} else if (typeof exports !== 'undefined') { |
|
|
|
createBlob, createObjectURL, createPromiseCapability, deprecated, |
|
|
|
factory(exports, require('../shared/util.js'), require('./dom_utils.js'), |
|
|
|
getVerbosityLevel, globalScope, InvalidPDFException, isLittleEndian, |
|
|
|
require('./api.js'), require('./annotation_layer.js'), |
|
|
|
MissingPDFException, OPS, PageViewport, PasswordException, PasswordResponses, |
|
|
|
require('./text_layer.js'), require('./metadata.js'), |
|
|
|
removeNullCharacters, setVerbosityLevel, shadow, UnexpectedResponseException, |
|
|
|
require('./svg.js')); |
|
|
|
UnknownErrorException, UNSUPPORTED_FEATURES, Util, VERBOSITY_LEVELS, warn |
|
|
|
} else { |
|
|
|
} from '../shared/util'; |
|
|
|
factory((root.pdfjsDisplayGlobal = {}), root.pdfjsSharedUtil, |
|
|
|
import { AnnotationLayer } from './annotation_layer'; |
|
|
|
root.pdfjsDisplayDOMUtils, root.pdfjsDisplayAPI, |
|
|
|
import { Metadata } from './metadata'; |
|
|
|
root.pdfjsDisplayAnnotationLayer, root.pdfjsDisplayTextLayer, |
|
|
|
import { renderTextLayer } from './text_layer'; |
|
|
|
root.pdfjsDisplayMetadata, root.pdfjsDisplaySVG); |
|
|
|
import { SVGGraphics } from './svg'; |
|
|
|
} |
|
|
|
|
|
|
|
}(this, function (exports, sharedUtil, displayDOMUtils, displayAPI, |
|
|
|
|
|
|
|
displayAnnotationLayer, displayTextLayer, displayMetadata, |
|
|
|
|
|
|
|
displaySVG) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var globalScope = sharedUtil.globalScope; |
|
|
|
|
|
|
|
var deprecated = sharedUtil.deprecated; |
|
|
|
|
|
|
|
var warn = sharedUtil.warn; |
|
|
|
|
|
|
|
var LinkTarget = displayDOMUtils.LinkTarget; |
|
|
|
|
|
|
|
var DEFAULT_LINK_REL = displayDOMUtils.DEFAULT_LINK_REL; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var isWorker = (typeof window === 'undefined'); |
|
|
|
var isWorker = (typeof window === 'undefined'); |
|
|
|
|
|
|
|
|
|
|
@ -61,47 +51,45 @@ |
|
|
|
PDFJS.pdfBug = false; |
|
|
|
PDFJS.pdfBug = false; |
|
|
|
|
|
|
|
|
|
|
|
if (PDFJS.verbosity !== undefined) { |
|
|
|
if (PDFJS.verbosity !== undefined) { |
|
|
|
sharedUtil.setVerbosityLevel(PDFJS.verbosity); |
|
|
|
setVerbosityLevel(PDFJS.verbosity); |
|
|
|
} |
|
|
|
} |
|
|
|
delete PDFJS.verbosity; |
|
|
|
delete PDFJS.verbosity; |
|
|
|
Object.defineProperty(PDFJS, 'verbosity', { |
|
|
|
Object.defineProperty(PDFJS, 'verbosity', { |
|
|
|
get: function () { |
|
|
|
get: function () { |
|
|
|
return sharedUtil.getVerbosityLevel(); |
|
|
|
return getVerbosityLevel(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
set: function (level) { |
|
|
|
set: function (level) { |
|
|
|
sharedUtil.setVerbosityLevel(level); |
|
|
|
setVerbosityLevel(level); |
|
|
|
}, |
|
|
|
}, |
|
|
|
enumerable: true, |
|
|
|
enumerable: true, |
|
|
|
configurable: true |
|
|
|
configurable: true |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
PDFJS.VERBOSITY_LEVELS = sharedUtil.VERBOSITY_LEVELS; |
|
|
|
PDFJS.VERBOSITY_LEVELS = VERBOSITY_LEVELS; |
|
|
|
PDFJS.OPS = sharedUtil.OPS; |
|
|
|
PDFJS.OPS = OPS; |
|
|
|
PDFJS.UNSUPPORTED_FEATURES = sharedUtil.UNSUPPORTED_FEATURES; |
|
|
|
PDFJS.UNSUPPORTED_FEATURES = UNSUPPORTED_FEATURES; |
|
|
|
PDFJS.isValidUrl = displayDOMUtils.isValidUrl; |
|
|
|
PDFJS.isValidUrl = isValidUrl; |
|
|
|
PDFJS.shadow = sharedUtil.shadow; |
|
|
|
PDFJS.shadow = shadow; |
|
|
|
PDFJS.createBlob = sharedUtil.createBlob; |
|
|
|
PDFJS.createBlob = createBlob; |
|
|
|
PDFJS.createObjectURL = function PDFJS_createObjectURL(data, contentType) { |
|
|
|
PDFJS.createObjectURL = function PDFJS_createObjectURL(data, contentType) { |
|
|
|
return sharedUtil.createObjectURL(data, contentType, |
|
|
|
return createObjectURL(data, contentType, PDFJS.disableCreateObjectURL); |
|
|
|
PDFJS.disableCreateObjectURL); |
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
Object.defineProperty(PDFJS, 'isLittleEndian', { |
|
|
|
Object.defineProperty(PDFJS, 'isLittleEndian', { |
|
|
|
configurable: true, |
|
|
|
configurable: true, |
|
|
|
get: function PDFJS_isLittleEndian() { |
|
|
|
get: function PDFJS_isLittleEndian() { |
|
|
|
var value = sharedUtil.isLittleEndian(); |
|
|
|
return shadow(PDFJS, 'isLittleEndian', isLittleEndian()); |
|
|
|
return sharedUtil.shadow(PDFJS, 'isLittleEndian', value); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
PDFJS.removeNullCharacters = sharedUtil.removeNullCharacters; |
|
|
|
PDFJS.removeNullCharacters = removeNullCharacters; |
|
|
|
PDFJS.PasswordResponses = sharedUtil.PasswordResponses; |
|
|
|
PDFJS.PasswordResponses = PasswordResponses; |
|
|
|
PDFJS.PasswordException = sharedUtil.PasswordException; |
|
|
|
PDFJS.PasswordException = PasswordException; |
|
|
|
PDFJS.UnknownErrorException = sharedUtil.UnknownErrorException; |
|
|
|
PDFJS.UnknownErrorException = UnknownErrorException; |
|
|
|
PDFJS.InvalidPDFException = sharedUtil.InvalidPDFException; |
|
|
|
PDFJS.InvalidPDFException = InvalidPDFException; |
|
|
|
PDFJS.MissingPDFException = sharedUtil.MissingPDFException; |
|
|
|
PDFJS.MissingPDFException = MissingPDFException; |
|
|
|
PDFJS.UnexpectedResponseException = sharedUtil.UnexpectedResponseException; |
|
|
|
PDFJS.UnexpectedResponseException = UnexpectedResponseException; |
|
|
|
PDFJS.Util = sharedUtil.Util; |
|
|
|
PDFJS.Util = Util; |
|
|
|
PDFJS.PageViewport = sharedUtil.PageViewport; |
|
|
|
PDFJS.PageViewport = PageViewport; |
|
|
|
PDFJS.createPromiseCapability = sharedUtil.createPromiseCapability; |
|
|
|
PDFJS.createPromiseCapability = createPromiseCapability; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* The maximum allowed image size in total pixels e.g. width * height. Images |
|
|
|
* The maximum allowed image size in total pixels e.g. width * height. Images |
|
|
@ -292,28 +280,29 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
PDFJS.getDocument = displayAPI.getDocument; |
|
|
|
PDFJS.getDocument = getDocument; |
|
|
|
PDFJS.PDFDataRangeTransport = displayAPI.PDFDataRangeTransport; |
|
|
|
PDFJS.PDFDataRangeTransport = PDFDataRangeTransport; |
|
|
|
PDFJS.PDFWorker = displayAPI.PDFWorker; |
|
|
|
PDFJS.PDFWorker = PDFWorker; |
|
|
|
|
|
|
|
|
|
|
|
PDFJS.hasCanvasTypedArrays = true; // compatibility.js ensures this invariant
|
|
|
|
PDFJS.hasCanvasTypedArrays = true; // compatibility.js ensures this invariant
|
|
|
|
PDFJS.CustomStyle = displayDOMUtils.CustomStyle; |
|
|
|
PDFJS.CustomStyle = CustomStyle; |
|
|
|
PDFJS.LinkTarget = LinkTarget; |
|
|
|
PDFJS.LinkTarget = LinkTarget; |
|
|
|
PDFJS.addLinkAttributes = displayDOMUtils.addLinkAttributes; |
|
|
|
PDFJS.addLinkAttributes = addLinkAttributes; |
|
|
|
PDFJS.getFilenameFromUrl = displayDOMUtils.getFilenameFromUrl; |
|
|
|
PDFJS.getFilenameFromUrl = getFilenameFromUrl; |
|
|
|
PDFJS.isExternalLinkTargetSet = displayDOMUtils.isExternalLinkTargetSet; |
|
|
|
PDFJS.isExternalLinkTargetSet = isExternalLinkTargetSet; |
|
|
|
|
|
|
|
|
|
|
|
PDFJS.AnnotationLayer = displayAnnotationLayer.AnnotationLayer; |
|
|
|
PDFJS.AnnotationLayer = AnnotationLayer; |
|
|
|
|
|
|
|
|
|
|
|
PDFJS.renderTextLayer = displayTextLayer.renderTextLayer; |
|
|
|
PDFJS.renderTextLayer = renderTextLayer; |
|
|
|
|
|
|
|
|
|
|
|
PDFJS.Metadata = displayMetadata.Metadata; |
|
|
|
PDFJS.Metadata = Metadata; |
|
|
|
|
|
|
|
|
|
|
|
PDFJS.SVGGraphics = displaySVG.SVGGraphics; |
|
|
|
PDFJS.SVGGraphics = SVGGraphics; |
|
|
|
|
|
|
|
|
|
|
|
PDFJS.UnsupportedManager = displayAPI._UnsupportedManager; |
|
|
|
PDFJS.UnsupportedManager = _UnsupportedManager; |
|
|
|
|
|
|
|
|
|
|
|
exports.globalScope = globalScope; |
|
|
|
export { |
|
|
|
exports.isWorker = isWorker; |
|
|
|
globalScope, |
|
|
|
exports.PDFJS = globalScope.PDFJS; |
|
|
|
isWorker, |
|
|
|
})); |
|
|
|
PDFJS, |
|
|
|
|
|
|
|
}; |
|
|
|