Browse Source

PDF.js version 2.0.87 - See mozilla/pdf.js@b46443f0c1ab2e8e304a715c75ae43c00b12a5c7

master v2.0.87
pdfjsbot 7 years ago
parent
commit
b1304dcc47
  1. 2
      bower.json
  2. 1057
      build/pdf.combined.js
  3. 2
      build/pdf.combined.js.map
  4. 865
      build/pdf.js
  5. 2
      build/pdf.js.map
  6. 2
      build/pdf.min.js
  7. 861
      build/pdf.worker.js
  8. 2
      build/pdf.worker.js.map
  9. 2
      build/pdf.worker.min.js
  10. 8
      lib/core/obj.js
  11. 2
      lib/core/worker.js
  12. 74
      lib/display/api.js
  13. 10
      lib/display/dom_utils.js
  14. 35
      lib/display/global.js
  15. 6
      lib/display/metadata.js
  16. 5
      lib/pdf.js
  17. 4
      lib/pdf.worker.js
  18. 12
      lib/shared/compatibility.js
  19. 6
      lib/test/unit/api_spec.js
  20. 6
      lib/test/unit/custom_spec.js
  21. 1
      lib/test/unit/jasmine-boot.js
  22. 10
      lib/web/app.js
  23. 4
      lib/web/base_viewer.js
  24. 17
      lib/web/pdf_cursor_tools.js
  25. 4
      lib/web/pdf_link_service.js
  26. 8
      lib/web/pdf_page_view.js
  27. 2
      lib/web/pdf_thumbnail_view.js
  28. 2
      package.json
  29. 657
      web/compatibility.js
  30. 2
      web/compatibility.js.map
  31. 16
      web/pdf_viewer.js
  32. 2
      web/pdf_viewer.js.map

2
bower.json

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
{
"name": "pdfjs-dist",
"version": "1.10.97",
"version": "2.0.87",
"main": [
"build/pdf.js",
"build/pdf.worker.js"

1057
build/pdf.combined.js

File diff suppressed because it is too large Load Diff

2
build/pdf.combined.js.map

File diff suppressed because one or more lines are too long

865
build/pdf.js

File diff suppressed because it is too large Load Diff

2
build/pdf.js.map

File diff suppressed because one or more lines are too long

2
build/pdf.min.js vendored

File diff suppressed because one or more lines are too long

861
build/pdf.worker.js vendored

File diff suppressed because it is too large Load Diff

2
build/pdf.worker.js.map vendored

File diff suppressed because one or more lines are too long

2
build/pdf.worker.min.js vendored

File diff suppressed because one or more lines are too long

8
lib/core/obj.js

@ -356,7 +356,7 @@ var Catalog = function CatalogClosure() { @@ -356,7 +356,7 @@ var Catalog = function CatalogClosure() {
get javaScript() {
var xref = this.xref;
var obj = this.catDict.get('Names');
var javaScript = [];
var javaScript = null;
function appendIfJavaScriptDict(jsDict) {
var type = jsDict.get('S');
if (!(0, _primitives.isName)(type, 'JavaScript')) {
@ -368,6 +368,9 @@ var Catalog = function CatalogClosure() { @@ -368,6 +368,9 @@ var Catalog = function CatalogClosure() {
} else if (!(0, _util.isString)(js)) {
return;
}
if (!javaScript) {
javaScript = [];
}
javaScript.push((0, _util.stringToPDFString)(js));
}
if (obj && obj.has('JavaScript')) {
@ -386,6 +389,9 @@ var Catalog = function CatalogClosure() { @@ -386,6 +389,9 @@ var Catalog = function CatalogClosure() {
if ((0, _primitives.isName)(actionType, 'Named')) {
var action = openactionDict.get('N');
if ((0, _primitives.isName)(action, 'Print')) {
if (!javaScript) {
javaScript = [];
}
javaScript.push('print({});');
}
} else {

2
lib/core/worker.js

@ -208,7 +208,7 @@ var WorkerMessageHandler = { @@ -208,7 +208,7 @@ var WorkerMessageHandler = {
var cancelXHRs = null;
var WorkerTasks = [];
var apiVersion = docParams.apiVersion;
var workerVersion = '1.10.97';
var workerVersion = '2.0.87';
if (apiVersion !== null && apiVersion !== workerVersion) {
throw new Error('The API version "' + apiVersion + '" does not match ' + ('the Worker version "' + workerVersion + '".'));
}

74
lib/display/api.js

@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.build = exports.version = exports._UnsupportedManager = exports.setPDFNetworkStreamClass = exports.PDFPageProxy = exports.PDFDocumentProxy = exports.PDFWorker = exports.PDFDataRangeTransport = exports.LoopbackPort = exports.getDocument = undefined;
exports.build = exports.version = exports.setPDFNetworkStreamClass = exports.PDFPageProxy = exports.PDFDocumentProxy = exports.PDFWorker = exports.PDFDataRangeTransport = exports.LoopbackPort = exports.getDocument = 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; }; }();
@ -80,25 +80,8 @@ var PDFNetworkStream; @@ -80,25 +80,8 @@ var PDFNetworkStream;
function setPDFNetworkStreamClass(cls) {
PDFNetworkStream = cls;
}
function getDocument(src, pdfDataRangeTransport, passwordCallback, progressCallback) {
function getDocument(src) {
var task = new PDFDocumentLoadingTask();
if (arguments.length > 1) {
(0, _util.deprecated)('getDocument is called with pdfDataRangeTransport, ' + 'passwordCallback or progressCallback argument');
}
if (pdfDataRangeTransport) {
if (!(pdfDataRangeTransport instanceof PDFDataRangeTransport)) {
pdfDataRangeTransport = Object.create(pdfDataRangeTransport);
pdfDataRangeTransport.length = src.length;
pdfDataRangeTransport.initialData = src.initialData;
if (!pdfDataRangeTransport.abort) {
pdfDataRangeTransport.abort = function () {};
}
}
src = Object.create(src);
src.range = pdfDataRangeTransport;
}
task.onPassword = passwordCallback || null;
task.onProgress = progressCallback || null;
var source;
if (typeof src === 'string') {
source = { url: src };
@ -149,12 +132,8 @@ function getDocument(src, pdfDataRangeTransport, passwordCallback, progressCallb @@ -149,12 +132,8 @@ function getDocument(src, pdfDataRangeTransport, passwordCallback, progressCallb
}
params.rangeChunkSize = params.rangeChunkSize || DEFAULT_RANGE_CHUNK_SIZE;
params.ignoreErrors = params.stopAtErrors !== true;
if (params.disableNativeImageDecoder !== undefined) {
(0, _util.deprecated)('parameter disableNativeImageDecoder, ' + 'use nativeImageDecoderSupport instead');
}
params.nativeImageDecoderSupport = params.nativeImageDecoderSupport || (params.disableNativeImageDecoder === true ? _util.NativeImageDecoding.NONE : _util.NativeImageDecoding.DECODE);
if (params.nativeImageDecoderSupport !== _util.NativeImageDecoding.DECODE && params.nativeImageDecoderSupport !== _util.NativeImageDecoding.NONE && params.nativeImageDecoderSupport !== _util.NativeImageDecoding.DISPLAY) {
(0, _util.warn)('Invalid parameter nativeImageDecoderSupport: ' + 'need a state of enum {NativeImageDecoding}');
var nativeImageDecoderValues = Object.values(_util.NativeImageDecoding);
if (params.nativeImageDecoderSupport === undefined || !nativeImageDecoderValues.includes(params.nativeImageDecoderSupport)) {
params.nativeImageDecoderSupport = _util.NativeImageDecoding.DECODE;
}
if (!worker) {
@ -193,7 +172,7 @@ function _fetchDocument(worker, source, pdfDataRangeTransport, docId) { @@ -193,7 +172,7 @@ function _fetchDocument(worker, source, pdfDataRangeTransport, docId) {
if (worker.destroyed) {
return Promise.reject(new Error('Worker was destroyed'));
}
var apiVersion = '1.10.97';
var apiVersion = '2.0.87';
source.disableAutoFetch = (0, _dom_utils.getDefaultSetting)('disableAutoFetch');
source.disableStream = (0, _dom_utils.getDefaultSetting)('disableStream');
source.chunkedViewerLoading = !!pdfDataRangeTransport;
@ -353,9 +332,10 @@ var PDFDocumentProxy = function PDFDocumentProxyClosure() { @@ -353,9 +332,10 @@ var PDFDocumentProxy = function PDFDocumentProxyClosure() {
getAttachments: function PDFDocumentProxy_getAttachments() {
return this.transport.getAttachments();
},
getJavaScript: function PDFDocumentProxy_getJavaScript() {
getJavaScript: function getJavaScript() {
return this.transport.getJavaScript();
},
getOutline: function PDFDocumentProxy_getOutline() {
return this.transport.getOutline();
},
@ -475,10 +455,6 @@ var PDFPageProxy = function PDFPageProxyClosure() { @@ -475,10 +455,6 @@ var PDFPageProxy = function PDFPageProxyClosure() {
}
intentState.renderTasks.push(internalRenderTask);
var renderTask = internalRenderTask.task;
if (params.continueCallback) {
(0, _util.deprecated)('render is used with continueCallback parameter');
renderTask.onContinue = params.continueCallback;
}
intentState.displayReadyCapability.promise.then(function (transparency) {
if (_this4.pendingCleanup) {
complete();
@ -587,11 +563,6 @@ var PDFPageProxy = function PDFPageProxyClosure() { @@ -587,11 +563,6 @@ var PDFPageProxy = function PDFPageProxyClosure() {
this.pendingCleanup = false;
return Promise.all(waitOn);
},
destroy: function destroy() {
(0, _util.deprecated)('page destroy method, use cleanup() instead');
this.cleanup();
},
cleanup: function PDFPageProxy_cleanup() {
this.pendingCleanup = true;
this._tryCleanup();
@ -1223,16 +1194,14 @@ var WorkerTransport = function WorkerTransportClosure() { @@ -1223,16 +1194,14 @@ var WorkerTransport = function WorkerTransportClosure() {
}
}
}, this);
messageHandler.on('UnsupportedFeature', function transportUnsupportedFeature(data) {
messageHandler.on('UnsupportedFeature', function (data) {
if (this.destroyed) {
return;
}
var featureId = data.featureId;
var loadingTask = this.loadingTask;
if (loadingTask.onUnsupportedFeature) {
loadingTask.onUnsupportedFeature(featureId);
loadingTask.onUnsupportedFeature(data.featureId);
}
_UnsupportedManager.notify(featureId);
}, this);
messageHandler.on('JpegDecode', function (data) {
if (this.destroyed) {
@ -1510,11 +1479,7 @@ var InternalRenderTask = function InternalRenderTaskClosure() { @@ -1510,11 +1479,7 @@ var InternalRenderTask = function InternalRenderTaskClosure() {
if (this._canvas) {
canvasInRendering.delete(this._canvas);
}
if ((0, _dom_utils.getDefaultSetting)('pdfjsNext')) {
this.callback(new _dom_utils.RenderingCancelledException('Rendering cancelled, page ' + this.pageNumber, 'canvas'));
} else {
this.callback('cancelled');
}
this.callback(new _dom_utils.RenderingCancelledException('Rendering cancelled, page ' + this.pageNumber, 'canvas'));
},
operatorListChanged: function InternalRenderTask_operatorListChanged() {
if (!this.graphicsReady) {
@ -1568,24 +1533,10 @@ var InternalRenderTask = function InternalRenderTaskClosure() { @@ -1568,24 +1533,10 @@ var InternalRenderTask = function InternalRenderTaskClosure() {
};
return InternalRenderTask;
}();
var _UnsupportedManager = function UnsupportedManagerClosure() {
var listeners = [];
return {
listen: function listen(cb) {
(0, _util.deprecated)('Global UnsupportedManager.listen is used: ' + ' use PDFDocumentLoadingTask.onUnsupportedFeature instead');
listeners.push(cb);
},
notify: function notify(featureId) {
for (var i = 0, ii = listeners.length; i < ii; i++) {
listeners[i](featureId);
}
}
};
}();
var version, build;
{
exports.version = version = '1.10.97';
exports.build = build = '7d0fce73';
exports.version = version = '2.0.87';
exports.build = build = 'b46443f0';
}
exports.getDocument = getDocument;
exports.LoopbackPort = LoopbackPort;
@ -1594,6 +1545,5 @@ exports.PDFWorker = PDFWorker; @@ -1594,6 +1545,5 @@ exports.PDFWorker = PDFWorker;
exports.PDFDocumentProxy = PDFDocumentProxy;
exports.PDFPageProxy = PDFPageProxy;
exports.setPDFNetworkStreamClass = setPDFNetworkStreamClass;
exports._UnsupportedManager = _UnsupportedManager;
exports.version = version;
exports.build = build;

10
lib/display/dom_utils.js

@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
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.isValidUrl = exports.isExternalLinkTargetSet = exports.addLinkAttributes = exports.RenderingCancelledException = exports.CustomStyle = undefined;
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; }; }();
@ -428,8 +428,6 @@ function getDefaultSetting(id) { @@ -428,8 +428,6 @@ function getDefaultSetting(id) {
return globalSettings ? globalSettings.externalLinkRel : DEFAULT_LINK_REL;
case 'enableStats':
return !!(globalSettings && globalSettings.enableStats);
case 'pdfjsNext':
return !!(globalSettings && globalSettings.pdfjsNext);
default:
throw new Error('Unknown default setting: ' + id);
}
@ -446,16 +444,10 @@ function isExternalLinkTargetSet() { @@ -446,16 +444,10 @@ function isExternalLinkTargetSet() {
return true;
}
}
function isValidUrl(url, allowRelative) {
(0, _util.deprecated)('isValidUrl(), please use createValidAbsoluteUrl() instead.');
var baseUrl = allowRelative ? 'http://example.com' : null;
return (0, _util.createValidAbsoluteUrl)(url, baseUrl) !== null;
}
exports.CustomStyle = CustomStyle;
exports.RenderingCancelledException = RenderingCancelledException;
exports.addLinkAttributes = addLinkAttributes;
exports.isExternalLinkTargetSet = isExternalLinkTargetSet;
exports.isValidUrl = isValidUrl;
exports.getFilenameFromUrl = getFilenameFromUrl;
exports.LinkTarget = LinkTarget;
exports.getDefaultSetting = getDefaultSetting;

35
lib/display/global.js

@ -19,12 +19,12 @@ Object.defineProperty(exports, "__esModule", { @@ -19,12 +19,12 @@ Object.defineProperty(exports, "__esModule", {
});
exports.PDFJS = exports.globalScope = undefined;
var _api = require('./api');
var _dom_utils = require('./dom_utils');
var _util = require('../shared/util');
var _api = require('./api');
var _annotation_layer = require('./annotation_layer');
var _global_scope = require('../shared/global_scope');
@ -44,8 +44,8 @@ if (!_global_scope2.default.PDFJS) { @@ -44,8 +44,8 @@ if (!_global_scope2.default.PDFJS) {
}
var PDFJS = _global_scope2.default.PDFJS;
{
PDFJS.version = '1.10.97';
PDFJS.build = '7d0fce73';
PDFJS.version = '2.0.87';
PDFJS.build = 'b46443f0';
}
PDFJS.pdfBug = false;
if (PDFJS.verbosity !== undefined) {
@ -106,32 +106,6 @@ PDFJS.disableWebGL = PDFJS.disableWebGL === undefined ? true : PDFJS.disableWebG @@ -106,32 +106,6 @@ PDFJS.disableWebGL = PDFJS.disableWebGL === undefined ? true : PDFJS.disableWebG
PDFJS.externalLinkTarget = PDFJS.externalLinkTarget === undefined ? _dom_utils.LinkTarget.NONE : PDFJS.externalLinkTarget;
PDFJS.externalLinkRel = PDFJS.externalLinkRel === undefined ? _dom_utils.DEFAULT_LINK_REL : PDFJS.externalLinkRel;
PDFJS.isEvalSupported = PDFJS.isEvalSupported === undefined ? true : PDFJS.isEvalSupported;
PDFJS.pdfjsNext = PDFJS.pdfjsNext === undefined ? false : PDFJS.pdfjsNext;
{
var savedOpenExternalLinksInNewWindow = PDFJS.openExternalLinksInNewWindow;
delete PDFJS.openExternalLinksInNewWindow;
Object.defineProperty(PDFJS, 'openExternalLinksInNewWindow', {
get: function get() {
return PDFJS.externalLinkTarget === _dom_utils.LinkTarget.BLANK;
},
set: function set(value) {
if (value) {
(0, _util.deprecated)('PDFJS.openExternalLinksInNewWindow, please use ' + '"PDFJS.externalLinkTarget = PDFJS.LinkTarget.BLANK" instead.');
}
if (PDFJS.externalLinkTarget !== _dom_utils.LinkTarget.NONE) {
(0, _util.warn)('PDFJS.externalLinkTarget is already initialized');
return;
}
PDFJS.externalLinkTarget = value ? _dom_utils.LinkTarget.BLANK : _dom_utils.LinkTarget.NONE;
},
enumerable: true,
configurable: true
});
if (savedOpenExternalLinksInNewWindow) {
PDFJS.openExternalLinksInNewWindow = savedOpenExternalLinksInNewWindow;
}
}
PDFJS.getDocument = _api.getDocument;
PDFJS.LoopbackPort = _api.LoopbackPort;
PDFJS.PDFDataRangeTransport = _api.PDFDataRangeTransport;
@ -146,6 +120,5 @@ PDFJS.AnnotationLayer = _annotation_layer.AnnotationLayer; @@ -146,6 +120,5 @@ PDFJS.AnnotationLayer = _annotation_layer.AnnotationLayer;
PDFJS.renderTextLayer = _text_layer.renderTextLayer;
PDFJS.Metadata = _metadata.Metadata;
PDFJS.SVGGraphics = _svg.SVGGraphics;
PDFJS.UnsupportedManager = _api._UnsupportedManager;
exports.globalScope = _global_scope2.default;
exports.PDFJS = PDFJS;

6
lib/display/metadata.js

@ -102,12 +102,6 @@ var Metadata = function () { @@ -102,12 +102,6 @@ var Metadata = function () {
value: function has(name) {
return typeof this._metadata[name] !== 'undefined';
}
}, {
key: 'metadata',
get: function get() {
(0, _util.deprecated)('`metadata` getter; use `getAll()` instead.');
return this.getAll();
}
}]);
return Metadata;

5
lib/pdf.js

@ -14,8 +14,8 @@ @@ -14,8 +14,8 @@
*/
'use strict';
var pdfjsVersion = '1.10.97';
var pdfjsBuild = '7d0fce73';
var pdfjsVersion = '2.0.87';
var pdfjsBuild = 'b46443f0';
var pdfjsSharedUtil = require('./shared/util.js');
var pdfjsDisplayGlobal = require('./display/global.js');
var pdfjsDisplayAPI = require('./display/api.js');
@ -54,7 +54,6 @@ exports.NativeImageDecoding = pdfjsSharedUtil.NativeImageDecoding; @@ -54,7 +54,6 @@ exports.NativeImageDecoding = pdfjsSharedUtil.NativeImageDecoding;
exports.UnexpectedResponseException = pdfjsSharedUtil.UnexpectedResponseException;
exports.OPS = pdfjsSharedUtil.OPS;
exports.UNSUPPORTED_FEATURES = pdfjsSharedUtil.UNSUPPORTED_FEATURES;
exports.isValidUrl = pdfjsDisplayDOMUtils.isValidUrl;
exports.createValidAbsoluteUrl = pdfjsSharedUtil.createValidAbsoluteUrl;
exports.createObjectURL = pdfjsSharedUtil.createObjectURL;
exports.removeNullCharacters = pdfjsSharedUtil.removeNullCharacters;

4
lib/pdf.worker.js vendored

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
*/
'use strict';
var pdfjsVersion = '1.10.97';
var pdfjsBuild = '7d0fce73';
var pdfjsVersion = '2.0.87';
var pdfjsBuild = 'b46443f0';
var pdfjsCoreWorker = require('./core/worker.js');
exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler;

12
lib/shared/compatibility.js

@ -668,6 +668,18 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) { @@ -668,6 +668,18 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
}
};
})();
(function checkObjectValues() {
if (Object.values) {
return;
}
Object.values = require('core-js/fn/object/values');
})();
(function checkArrayIncludes() {
if (Array.prototype.includes) {
return;
}
Array.prototype.includes = require('core-js/fn/array/includes');
})();
(function checkNumberIsNaN() {
if (Number.isNaN) {
return;

6
lib/test/unit/api_spec.js

@ -32,9 +32,7 @@ describe('api', function () { @@ -32,9 +32,7 @@ describe('api', function () {
var basicApiGetDocumentParams = (0, _test_utils.buildGetDocumentParams)(basicApiFileName);
var CanvasFactory = void 0;
beforeAll(function (done) {
if ((0, _util.isNodeJS)()) {
_global.PDFJS.pdfjsNext = true;
} else {
if ((0, _util.isNodeJS)()) {} else {
CanvasFactory = new _dom_utils.DOMCanvasFactory();
}
done();
@ -585,7 +583,7 @@ describe('api', function () { @@ -585,7 +583,7 @@ describe('api', function () {
it('gets javascript', function (done) {
var promise = doc.getJavaScript();
promise.then(function (data) {
expect(data).toEqual([]);
expect(data).toEqual(null);
done();
}).catch(function (reason) {
done.fail(reason);

6
lib/test/unit/custom_spec.js

@ -22,8 +22,6 @@ var _api = require('../../display/api'); @@ -22,8 +22,6 @@ var _api = require('../../display/api');
var _util = require('../../shared/util');
var _global = require('../../display/global');
function getTopLeftPixel(canvasContext) {
var imgData = canvasContext.getImageData(0, 0, 1, 1);
return {
@ -39,9 +37,7 @@ describe('custom canvas rendering', function () { @@ -39,9 +37,7 @@ describe('custom canvas rendering', function () {
var loadingTask = void 0;
var page = void 0;
beforeAll(function (done) {
if ((0, _util.isNodeJS)()) {
_global.PDFJS.pdfjsNext = true;
} else {
if ((0, _util.isNodeJS)()) {} else {
CanvasFactory = new _dom_utils.DOMCanvasFactory();
}
loadingTask = (0, _api.getDocument)(transparentGetDocumentParams);

1
lib/test/unit/jasmine-boot.js

@ -28,7 +28,6 @@ function initializePDFJS(callback) { @@ -28,7 +28,6 @@ function initializePDFJS(callback) {
displayApi.setPDFNetworkStreamClass(PDFNetworkStream);
}
displayGlobal.PDFJS.workerSrc = '../../build/generic/build/pdf.worker.js';
displayGlobal.PDFJS.pdfjsNext = true;
callback();
});
}

10
lib/web/app.js

@ -461,9 +461,6 @@ var PDFViewerApplication = { @@ -461,9 +461,6 @@ var PDFViewerApplication = {
open: function open(file, args) {
var _this3 = this;
if (arguments.length > 2 || typeof args === 'number') {
return Promise.reject(new Error('Call of open() with obsolete signature.'));
}
if (this.pdfLoadingTask) {
return this.close().then(function () {
_this3.preferences.reload();
@ -482,10 +479,7 @@ var PDFViewerApplication = { @@ -482,10 +479,7 @@ var PDFViewerApplication = {
}
if (args) {
for (var prop in args) {
if (!_pdf.PDFJS.pdfjsNext && prop === 'scale') {
console.error('Call of open() with obsolete "scale" argument, ' + 'please use the "defaultZoomValue" preference instead.');
continue;
} else if (prop === 'length') {
if (prop === 'length') {
this.pdfDocumentProperties.setFileSize(args[prop]);
}
parameters[prop] = args[prop];
@ -745,7 +739,7 @@ var PDFViewerApplication = { @@ -745,7 +739,7 @@ var PDFViewerApplication = {
return;
}
pdfDocument.getJavaScript().then(function (javaScript) {
if (javaScript.length === 0) {
if (!javaScript) {
return;
}
javaScript.some(function (js) {

4
lib/web/base_viewer.js

@ -398,10 +398,6 @@ var BaseViewer = function () { @@ -398,10 +398,6 @@ var BaseViewer = function () {
}, {
key: 'scrollPageIntoView',
value: function scrollPageIntoView(params) {
if (arguments.length > 1 || typeof params === 'number') {
console.error('Call of scrollPageIntoView() with obsolete signature.');
return;
}
if (!this.pdfDocument) {
return;
}

17
lib/web/pdf_cursor_tools.js

@ -19,8 +19,6 @@ Object.defineProperty(exports, "__esModule", { @@ -19,8 +19,6 @@ Object.defineProperty(exports, "__esModule", {
});
exports.PDFCursorTools = exports.CursorTool = undefined;
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
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; }; }();
var _grab_to_pan = require('./grab_to_pan');
@ -49,19 +47,8 @@ var PDFCursorTools = function () { @@ -49,19 +47,8 @@ var PDFCursorTools = function () {
this.activeBeforePresentationMode = null;
this.handTool = new _grab_to_pan.GrabToPan({ element: this.container });
this._addEventListeners();
Promise.all([preferences.get('cursorToolOnLoad'), preferences.get('enableHandToolOnLoad')]).then(function (_ref2) {
var _ref3 = _slicedToArray(_ref2, 2),
cursorToolPref = _ref3[0],
handToolPref = _ref3[1];
if (handToolPref === true) {
preferences.set('enableHandToolOnLoad', false);
if (cursorToolPref === CursorTool.SELECT) {
cursorToolPref = CursorTool.HAND;
preferences.set('cursorToolOnLoad', cursorToolPref).catch(function () {});
}
}
_this.switchTool(cursorToolPref);
preferences.get('cursorToolOnLoad').then(function (value) {
_this.switchTool(value);
}).catch(function () {});
}

4
lib/web/pdf_link_service.js

@ -207,10 +207,6 @@ var PDFLinkService = function () { @@ -207,10 +207,6 @@ var PDFLinkService = function () {
});
}
} else {
if (/^\d+$/.test(hash) && hash <= this.pagesCount) {
console.warn('PDFLinkService_setHash: specifying a page number ' + 'directly after the hash symbol (#) is deprecated, ' + ('please use the "#page=' + hash + '" form instead.'));
this.page = hash | 0;
}
dest = unescape(hash);
try {
dest = JSON.parse(dest);

8
lib/web/pdf_page_view.js

@ -340,7 +340,7 @@ var PDFPageView = function () { @@ -340,7 +340,7 @@ var PDFPageView = function () {
if (paintTask === _this.paintTask) {
_this.paintTask = null;
}
if (error === 'cancelled' || error instanceof _pdf.RenderingCancelledException) {
if (error instanceof _pdf.RenderingCancelledException) {
_this.error = null;
return Promise.resolve(undefined);
}
@ -479,11 +479,7 @@ var PDFPageView = function () { @@ -479,11 +479,7 @@ var PDFPageView = function () {
var cancelled = false;
var ensureNotCancelled = function ensureNotCancelled() {
if (cancelled) {
if (_pdf.PDFJS.pdfjsNext) {
throw new _pdf.RenderingCancelledException('Rendering cancelled, page ' + _this2.id, 'svg');
} else {
throw 'cancelled';
}
throw new _pdf.RenderingCancelledException('Rendering cancelled, page ' + _this2.id, 'svg');
}
};
var pdfPage = this.pdfPage;

2
lib/web/pdf_thumbnail_view.js

@ -257,7 +257,7 @@ var PDFThumbnailView = function () { @@ -257,7 +257,7 @@ var PDFThumbnailView = function () {
if (renderTask === _this2.renderTask) {
_this2.renderTask = null;
}
if (error === 'cancelled' || error instanceof _pdf.RenderingCancelledException) {
if (error instanceof _pdf.RenderingCancelledException) {
renderCapability.resolve(undefined);
return;
}

2
package.json

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
{
"name": "pdfjs-dist",
"version": "1.10.97",
"version": "2.0.87",
"main": "build/pdf.js",
"description": "Generic build of Mozilla's PDF.js library.",
"keywords": [

657
web/compatibility.js

File diff suppressed because it is too large Load Diff

2
web/compatibility.js.map

File diff suppressed because one or more lines are too long

16
web/pdf_viewer.js

@ -953,10 +953,6 @@ var PDFLinkService = function () { @@ -953,10 +953,6 @@ var PDFLinkService = function () {
});
}
} else {
if (/^\d+$/.test(hash) && hash <= this.pagesCount) {
console.warn('PDFLinkService_setHash: specifying a page number ' + 'directly after the hash symbol (#) is deprecated, ' + ('please use the "#page=' + hash + '" form instead.'));
this.page = hash | 0;
}
dest = unescape(hash);
try {
dest = JSON.parse(dest);
@ -1558,10 +1554,6 @@ var BaseViewer = function () { @@ -1558,10 +1554,6 @@ var BaseViewer = function () {
}, {
key: 'scrollPageIntoView',
value: function scrollPageIntoView(params) {
if (arguments.length > 1 || typeof params === 'number') {
console.error('Call of scrollPageIntoView() with obsolete signature.');
return;
}
if (!this.pdfDocument) {
return;
}
@ -2565,7 +2557,7 @@ var PDFPageView = function () { @@ -2565,7 +2557,7 @@ var PDFPageView = function () {
if (paintTask === _this.paintTask) {
_this.paintTask = null;
}
if (error === 'cancelled' || error instanceof _pdfjsLib.RenderingCancelledException) {
if (error instanceof _pdfjsLib.RenderingCancelledException) {
_this.error = null;
return Promise.resolve(undefined);
}
@ -2704,11 +2696,7 @@ var PDFPageView = function () { @@ -2704,11 +2696,7 @@ var PDFPageView = function () {
var cancelled = false;
var ensureNotCancelled = function ensureNotCancelled() {
if (cancelled) {
if (_pdfjsLib.PDFJS.pdfjsNext) {
throw new _pdfjsLib.RenderingCancelledException('Rendering cancelled, page ' + _this2.id, 'svg');
} else {
throw 'cancelled';
}
throw new _pdfjsLib.RenderingCancelledException('Rendering cancelled, page ' + _this2.id, 'svg');
}
};
var pdfPage = this.pdfPage;

2
web/pdf_viewer.js.map

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save