|
@@ -98,7 +98,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
|
value: true
|
|
|
});
|
|
|
-exports.unreachable = exports.warn = exports.utf8StringToString = exports.stringToUTF8String = exports.stringToPDFString = exports.stringToBytes = exports.string32 = exports.shadow = exports.setVerbosityLevel = exports.ReadableStream = exports.removeNullCharacters = exports.readUint32 = exports.readUint16 = exports.readInt8 = exports.log2 = exports.loadJpegStream = exports.isEvalSupported = exports.isLittleEndian = exports.createValidAbsoluteUrl = exports.isSameOrigin = exports.isNodeJS = exports.isSpace = exports.isString = exports.isNum = exports.isEmptyObj = exports.isBool = exports.isArrayBuffer = exports.info = exports.getVerbosityLevel = exports.getLookupTableFactory = exports.deprecated = exports.createObjectURL = exports.createPromiseCapability = exports.createBlob = exports.bytesToString = exports.assert = exports.arraysToBytes = exports.arrayByteLength = exports.FormatError = exports.XRefParseException = exports.Util = exports.UnknownErrorException = exports.UnexpectedResponseException = exports.TextRenderingMode = exports.StreamType = exports.StatTimer = exports.PasswordResponses = exports.PasswordException = exports.PageViewport = exports.NotImplementedException = exports.NativeImageDecoding = exports.MissingPDFException = exports.MissingDataException = exports.MessageHandler = exports.InvalidPDFException = exports.AbortException = exports.CMapCompressionType = exports.ImageKind = exports.FontType = exports.AnnotationType = exports.AnnotationFlag = exports.AnnotationFieldFlag = exports.AnnotationBorderStyleType = exports.UNSUPPORTED_FEATURES = exports.VERBOSITY_LEVELS = exports.OPS = exports.IDENTITY_MATRIX = exports.FONT_IDENTITY_MATRIX = undefined;
|
|
|
+exports.unreachable = exports.warn = exports.utf8StringToString = exports.stringToUTF8String = exports.stringToPDFString = exports.stringToBytes = exports.string32 = exports.shadow = exports.setVerbosityLevel = exports.ReadableStream = exports.removeNullCharacters = exports.readUint32 = exports.readUint16 = exports.readInt8 = exports.log2 = exports.loadJpegStream = exports.isEvalSupported = exports.isLittleEndian = exports.createValidAbsoluteUrl = exports.isSameOrigin = exports.isNodeJS = exports.isSpace = exports.isString = exports.isNum = exports.isEmptyObj = exports.isBool = exports.isArrayBuffer = exports.info = exports.getVerbosityLevel = exports.getLookupTableFactory = exports.deprecated = exports.createObjectURL = exports.createPromiseCapability = exports.createBlob = exports.bytesToString = exports.assert = exports.arraysToBytes = exports.arrayByteLength = exports.FormatError = exports.XRefParseException = exports.Util = exports.UnknownErrorException = exports.UnexpectedResponseException = exports.TextRenderingMode = exports.StreamType = exports.PasswordResponses = exports.PasswordException = exports.PageViewport = exports.NotImplementedException = exports.NativeImageDecoding = exports.MissingPDFException = exports.MissingDataException = exports.MessageHandler = exports.InvalidPDFException = exports.AbortException = exports.CMapCompressionType = exports.ImageKind = exports.FontType = exports.AnnotationType = exports.AnnotationFlag = exports.AnnotationFieldFlag = exports.AnnotationBorderStyleType = exports.UNSUPPORTED_FEATURES = exports.VERBOSITY_LEVELS = exports.OPS = exports.IDENTITY_MATRIX = exports.FONT_IDENTITY_MATRIX = undefined;
|
|
|
|
|
|
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
|
|
|
|
@@ -906,63 +906,6 @@ function createPromiseCapability() {
|
|
|
});
|
|
|
return capability;
|
|
|
}
|
|
|
-var StatTimer = function StatTimerClosure() {
|
|
|
- function rpad(str, pad, length) {
|
|
|
- while (str.length < length) {
|
|
|
- str += pad;
|
|
|
- }
|
|
|
- return str;
|
|
|
- }
|
|
|
- function StatTimer() {
|
|
|
- this.started = Object.create(null);
|
|
|
- this.times = [];
|
|
|
- this.enabled = true;
|
|
|
- }
|
|
|
- StatTimer.prototype = {
|
|
|
- time: function StatTimer_time(name) {
|
|
|
- if (!this.enabled) {
|
|
|
- return;
|
|
|
- }
|
|
|
- if (name in this.started) {
|
|
|
- warn('Timer is already running for ' + name);
|
|
|
- }
|
|
|
- this.started[name] = Date.now();
|
|
|
- },
|
|
|
- timeEnd: function StatTimer_timeEnd(name) {
|
|
|
- if (!this.enabled) {
|
|
|
- return;
|
|
|
- }
|
|
|
- if (!(name in this.started)) {
|
|
|
- warn('Timer has not been started for ' + name);
|
|
|
- }
|
|
|
- this.times.push({
|
|
|
- 'name': name,
|
|
|
- 'start': this.started[name],
|
|
|
- 'end': Date.now()
|
|
|
- });
|
|
|
- delete this.started[name];
|
|
|
- },
|
|
|
- toString: function StatTimer_toString() {
|
|
|
- var i, ii;
|
|
|
- var times = this.times;
|
|
|
- var out = '';
|
|
|
- var longest = 0;
|
|
|
- for (i = 0, ii = times.length; i < ii; ++i) {
|
|
|
- var name = times[i]['name'];
|
|
|
- if (name.length > longest) {
|
|
|
- longest = name.length;
|
|
|
- }
|
|
|
- }
|
|
|
- for (i = 0, ii = times.length; i < ii; ++i) {
|
|
|
- var span = times[i];
|
|
|
- var duration = span.end - span.start;
|
|
|
- out += rpad(span['name'], ' ', longest) + ' ' + duration + 'ms\n';
|
|
|
- }
|
|
|
- return out;
|
|
|
- }
|
|
|
- };
|
|
|
- return StatTimer;
|
|
|
-}();
|
|
|
var createBlob = function createBlob(data, contentType) {
|
|
|
if (typeof Blob !== 'undefined') {
|
|
|
return new Blob([data], { type: contentType });
|
|
@@ -1427,7 +1370,6 @@ exports.NotImplementedException = NotImplementedException;
|
|
|
exports.PageViewport = PageViewport;
|
|
|
exports.PasswordException = PasswordException;
|
|
|
exports.PasswordResponses = PasswordResponses;
|
|
|
-exports.StatTimer = StatTimer;
|
|
|
exports.StreamType = StreamType;
|
|
|
exports.TextRenderingMode = TextRenderingMode;
|
|
|
exports.UnexpectedResponseException = UnexpectedResponseException;
|
|
@@ -2909,7 +2851,7 @@ module.exports = function (fn, that, length) {
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
|
value: true
|
|
|
});
|
|
|
-exports.SimpleXMLParser = exports.DOMSVGFactory = exports.DOMCMapReaderFactory = exports.DOMCanvasFactory = exports.DEFAULT_LINK_REL = exports.getDefaultSetting = exports.LinkTarget = exports.getFilenameFromUrl = exports.isExternalLinkTargetSet = exports.addLinkAttributes = exports.RenderingCancelledException = exports.CustomStyle = undefined;
|
|
|
+exports.DummyStatTimer = exports.StatTimer = exports.SimpleXMLParser = exports.DOMSVGFactory = exports.DOMCMapReaderFactory = exports.DOMCanvasFactory = exports.DEFAULT_LINK_REL = exports.getDefaultSetting = exports.LinkTarget = exports.getFilenameFromUrl = exports.isExternalLinkTargetSet = exports.addLinkAttributes = exports.RenderingCancelledException = exports.CustomStyle = undefined;
|
|
|
|
|
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
|
|
|
@@ -3336,6 +3278,100 @@ function isExternalLinkTargetSet() {
|
|
|
return true;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+var StatTimer = function () {
|
|
|
+ function StatTimer() {
|
|
|
+ var enable = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
|
+
|
|
|
+ _classCallCheck(this, StatTimer);
|
|
|
+
|
|
|
+ this.enabled = !!enable;
|
|
|
+ this.reset();
|
|
|
+ }
|
|
|
+
|
|
|
+ _createClass(StatTimer, [{
|
|
|
+ key: 'reset',
|
|
|
+ value: function reset() {
|
|
|
+ this.started = Object.create(null);
|
|
|
+ this.times = [];
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ key: 'time',
|
|
|
+ value: function time(name) {
|
|
|
+ if (!this.enabled) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (name in this.started) {
|
|
|
+ (0, _util.warn)('Timer is already running for ' + name);
|
|
|
+ }
|
|
|
+ this.started[name] = Date.now();
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ key: 'timeEnd',
|
|
|
+ value: function timeEnd(name) {
|
|
|
+ if (!this.enabled) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!(name in this.started)) {
|
|
|
+ (0, _util.warn)('Timer has not been started for ' + name);
|
|
|
+ }
|
|
|
+ this.times.push({
|
|
|
+ 'name': name,
|
|
|
+ 'start': this.started[name],
|
|
|
+ 'end': Date.now()
|
|
|
+ });
|
|
|
+ delete this.started[name];
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ key: 'toString',
|
|
|
+ value: function toString() {
|
|
|
+ var times = this.times;
|
|
|
+ var out = '',
|
|
|
+ longest = 0;
|
|
|
+ for (var i = 0, ii = times.length; i < ii; ++i) {
|
|
|
+ var name = times[i]['name'];
|
|
|
+ if (name.length > longest) {
|
|
|
+ longest = name.length;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for (var _i = 0, _ii = times.length; _i < _ii; ++_i) {
|
|
|
+ var span = times[_i];
|
|
|
+ var duration = span.end - span.start;
|
|
|
+ out += span['name'].padEnd(longest) + ' ' + duration + 'ms\n';
|
|
|
+ }
|
|
|
+ return out;
|
|
|
+ }
|
|
|
+ }]);
|
|
|
+
|
|
|
+ return StatTimer;
|
|
|
+}();
|
|
|
+
|
|
|
+var DummyStatTimer = function () {
|
|
|
+ function DummyStatTimer() {
|
|
|
+ _classCallCheck(this, DummyStatTimer);
|
|
|
+
|
|
|
+ throw new Error('Cannot initialize DummyStatTimer.');
|
|
|
+ }
|
|
|
+
|
|
|
+ _createClass(DummyStatTimer, null, [{
|
|
|
+ key: 'reset',
|
|
|
+ value: function reset() {}
|
|
|
+ }, {
|
|
|
+ key: 'time',
|
|
|
+ value: function time(name) {}
|
|
|
+ }, {
|
|
|
+ key: 'timeEnd',
|
|
|
+ value: function timeEnd(name) {}
|
|
|
+ }, {
|
|
|
+ key: 'toString',
|
|
|
+ value: function toString() {
|
|
|
+ return '';
|
|
|
+ }
|
|
|
+ }]);
|
|
|
+
|
|
|
+ return DummyStatTimer;
|
|
|
+}();
|
|
|
+
|
|
|
exports.CustomStyle = CustomStyle;
|
|
|
exports.RenderingCancelledException = RenderingCancelledException;
|
|
|
exports.addLinkAttributes = addLinkAttributes;
|
|
@@ -3348,6 +3384,8 @@ exports.DOMCanvasFactory = DOMCanvasFactory;
|
|
|
exports.DOMCMapReaderFactory = DOMCMapReaderFactory;
|
|
|
exports.DOMSVGFactory = DOMSVGFactory;
|
|
|
exports.SimpleXMLParser = SimpleXMLParser;
|
|
|
+exports.StatTimer = StatTimer;
|
|
|
+exports.DummyStatTimer = DummyStatTimer;
|
|
|
|
|
|
/***/ }),
|
|
|
/* 13 */
|
|
@@ -11607,7 +11645,7 @@ function _fetchDocument(worker, source, pdfDataRangeTransport, docId) {
|
|
|
if (worker.destroyed) {
|
|
|
return Promise.reject(new Error('Worker was destroyed'));
|
|
|
}
|
|
|
- var apiVersion = '2.0.187';
|
|
|
+ var apiVersion = '2.0.191';
|
|
|
source.disableRange = (0, _dom_utils.getDefaultSetting)('disableRange');
|
|
|
source.disableAutoFetch = (0, _dom_utils.getDefaultSetting)('disableAutoFetch');
|
|
|
source.disableStream = (0, _dom_utils.getDefaultSetting)('disableStream');
|
|
@@ -11801,8 +11839,7 @@ var PDFPageProxy = function PDFPageProxyClosure() {
|
|
|
this.pageIndex = pageIndex;
|
|
|
this.pageInfo = pageInfo;
|
|
|
this.transport = transport;
|
|
|
- this.stats = new _util.StatTimer();
|
|
|
- this.stats.enabled = (0, _dom_utils.getDefaultSetting)('enableStats');
|
|
|
+ this._stats = (0, _dom_utils.getDefaultSetting)('enableStats') ? new _dom_utils.StatTimer() : _dom_utils.DummyStatTimer;
|
|
|
this.commonObjs = transport.commonObjs;
|
|
|
this.objs = new PDFObjects();
|
|
|
this.cleanupAfterRender = false;
|
|
@@ -11843,7 +11880,7 @@ var PDFPageProxy = function PDFPageProxyClosure() {
|
|
|
render: function PDFPageProxy_render(params) {
|
|
|
var _this4 = this;
|
|
|
|
|
|
- var stats = this.stats;
|
|
|
+ var stats = this._stats;
|
|
|
stats.time('Overall');
|
|
|
this.pendingCleanup = false;
|
|
|
var renderingIntent = params.intent === 'print' ? 'print' : 'display';
|
|
@@ -11861,7 +11898,7 @@ var PDFPageProxy = function PDFPageProxyClosure() {
|
|
|
argsArray: [],
|
|
|
lastChunk: false
|
|
|
};
|
|
|
- this.stats.time('Page Request');
|
|
|
+ stats.time('Page Request');
|
|
|
this.transport.messageHandler.send('RenderPageRequest', {
|
|
|
pageIndex: this.pageNumber - 1,
|
|
|
intent: renderingIntent,
|
|
@@ -12000,11 +12037,15 @@ var PDFPageProxy = function PDFPageProxyClosure() {
|
|
|
this.pendingCleanup = false;
|
|
|
return Promise.all(waitOn);
|
|
|
},
|
|
|
- cleanup: function PDFPageProxy_cleanup() {
|
|
|
+ cleanup: function cleanup() {
|
|
|
+ var resetStats = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
|
+
|
|
|
this.pendingCleanup = true;
|
|
|
- this._tryCleanup();
|
|
|
+ this._tryCleanup(resetStats);
|
|
|
},
|
|
|
- _tryCleanup: function PDFPageProxy_tryCleanup() {
|
|
|
+ _tryCleanup: function _tryCleanup() {
|
|
|
+ var resetStats = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
|
+
|
|
|
if (!this.pendingCleanup || Object.keys(this.intentStates).some(function (intent) {
|
|
|
var intentState = this.intentStates[intent];
|
|
|
return intentState.renderTasks.length !== 0 || intentState.receivingOperatorList;
|
|
@@ -12016,8 +12057,12 @@ var PDFPageProxy = function PDFPageProxyClosure() {
|
|
|
}, this);
|
|
|
this.objs.clear();
|
|
|
this.annotationsPromise = null;
|
|
|
+ if (resetStats) {
|
|
|
+ this._stats.reset();
|
|
|
+ }
|
|
|
this.pendingCleanup = false;
|
|
|
},
|
|
|
+
|
|
|
_startRenderPage: function PDFPageProxy_startRenderPage(transparency, intent) {
|
|
|
var intentState = this.intentStates[intent];
|
|
|
if (intentState.displayReadyCapability) {
|
|
@@ -12039,6 +12084,9 @@ var PDFPageProxy = function PDFPageProxyClosure() {
|
|
|
intentState.receivingOperatorList = false;
|
|
|
this._tryCleanup();
|
|
|
}
|
|
|
+ },
|
|
|
+ get stats() {
|
|
|
+ return this._stats instanceof _dom_utils.StatTimer ? this._stats : null;
|
|
|
}
|
|
|
};
|
|
|
return PDFPageProxy;
|
|
@@ -12430,7 +12478,7 @@ var WorkerTransport = function WorkerTransportClosure() {
|
|
|
return;
|
|
|
}
|
|
|
var page = this.pageCache[data.pageIndex];
|
|
|
- page.stats.timeEnd('Page Request');
|
|
|
+ page._stats.timeEnd('Page Request');
|
|
|
page._startRenderPage(data.transparency, data.intent);
|
|
|
}, this);
|
|
|
messageHandler.on('RenderPageChunk', function transportRender(data) {
|
|
@@ -12887,8 +12935,8 @@ var InternalRenderTask = function InternalRenderTaskClosure() {
|
|
|
}();
|
|
|
var version, build;
|
|
|
{
|
|
|
- exports.version = version = '2.0.187';
|
|
|
- exports.build = build = '518da6c6';
|
|
|
+ exports.version = version = '2.0.191';
|
|
|
+ exports.build = build = '694c4171';
|
|
|
}
|
|
|
exports.getDocument = getDocument;
|
|
|
exports.LoopbackPort = LoopbackPort;
|
|
@@ -26543,8 +26591,8 @@ exports.SVGGraphics = SVGGraphics;
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
-var pdfjsVersion = '2.0.187';
|
|
|
-var pdfjsBuild = '518da6c6';
|
|
|
+var pdfjsVersion = '2.0.191';
|
|
|
+var pdfjsBuild = '694c4171';
|
|
|
var pdfjsSharedUtil = __w_pdfjs_require__(0);
|
|
|
var pdfjsDisplayGlobal = __w_pdfjs_require__(129);
|
|
|
var pdfjsDisplayAPI = __w_pdfjs_require__(65);
|
|
@@ -26591,7 +26639,6 @@ exports.createBlob = pdfjsSharedUtil.createBlob;
|
|
|
exports.RenderingCancelledException = pdfjsDisplayDOMUtils.RenderingCancelledException;
|
|
|
exports.getFilenameFromUrl = pdfjsDisplayDOMUtils.getFilenameFromUrl;
|
|
|
exports.addLinkAttributes = pdfjsDisplayDOMUtils.addLinkAttributes;
|
|
|
-exports.StatTimer = pdfjsSharedUtil.StatTimer;
|
|
|
|
|
|
/***/ }),
|
|
|
/* 80 */
|
|
@@ -31873,8 +31920,8 @@ if (!_global_scope2.default.PDFJS) {
|
|
|
}
|
|
|
var PDFJS = _global_scope2.default.PDFJS;
|
|
|
{
|
|
|
- PDFJS.version = '2.0.187';
|
|
|
- PDFJS.build = '518da6c6';
|
|
|
+ PDFJS.version = '2.0.191';
|
|
|
+ PDFJS.build = '694c4171';
|
|
|
}
|
|
|
PDFJS.pdfBug = false;
|
|
|
if (PDFJS.verbosity !== undefined) {
|
|
@@ -35234,7 +35281,7 @@ var WorkerMessageHandler = {
|
|
|
var cancelXHRs = null;
|
|
|
var WorkerTasks = [];
|
|
|
var apiVersion = docParams.apiVersion;
|
|
|
- var workerVersion = '2.0.187';
|
|
|
+ var workerVersion = '2.0.191';
|
|
|
if (apiVersion !== null && apiVersion !== workerVersion) {
|
|
|
throw new Error('The API version "' + apiVersion + '" does not match ' + ('the Worker version "' + workerVersion + '".'));
|
|
|
}
|