Browse Source

PDF.js version 1.8.462 - See mozilla/pdf.js@db52e4fb73dcb0eb47d88a7a09ec82c3374fe052

master v1.8.462
pdfjsbot 8 years ago
parent
commit
d9fc193878
  1. 2
      bower.json
  2. 110
      build/pdf.combined.js
  3. 2
      build/pdf.combined.js.map
  4. 12
      build/pdf.js
  5. 2
      build/pdf.js.map
  6. 4
      build/pdf.min.js
  7. 102
      build/pdf.worker.js
  8. 2
      build/pdf.worker.js.map
  9. 36
      build/pdf.worker.min.js
  10. 2
      lib/core/annotation.js
  11. 2
      lib/core/document.js
  12. 62
      lib/core/obj.js
  13. 32
      lib/core/primitives.js
  14. 4
      lib/display/api.js
  15. 4
      lib/display/global.js
  16. 4
      lib/pdf.js
  17. 4
      lib/pdf.worker.js
  18. 2
      package.json

2
bower.json

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

110
build/pdf.combined.js

@ -1482,7 +1482,7 @@ var Dict = function DictClosure() {
return nonSerializable; return nonSerializable;
}; };
function Dict(xref) { function Dict(xref) {
this.map = Object.create(null); this._map = Object.create(null);
this.xref = xref; this.xref = xref;
this.objId = null; this.objId = null;
this.suppressEncryption = false; this.suppressEncryption = false;
@ -1496,32 +1496,32 @@ var Dict = function DictClosure() {
var value; var value;
var xref = this.xref, var xref = this.xref,
suppressEncryption = this.suppressEncryption; suppressEncryption = this.suppressEncryption;
if (typeof (value = this.map[key1]) !== 'undefined' || key1 in this.map || typeof key2 === 'undefined') { if (typeof (value = this._map[key1]) !== 'undefined' || key1 in this._map || typeof key2 === 'undefined') {
return xref ? xref.fetchIfRef(value, suppressEncryption) : value; return xref ? xref.fetchIfRef(value, suppressEncryption) : value;
} }
if (typeof (value = this.map[key2]) !== 'undefined' || key2 in this.map || typeof key3 === 'undefined') { if (typeof (value = this._map[key2]) !== 'undefined' || key2 in this._map || typeof key3 === 'undefined') {
return xref ? xref.fetchIfRef(value, suppressEncryption) : value; return xref ? xref.fetchIfRef(value, suppressEncryption) : value;
} }
value = this.map[key3] || null; value = this._map[key3] || null;
return xref ? xref.fetchIfRef(value, suppressEncryption) : value; return xref ? xref.fetchIfRef(value, suppressEncryption) : value;
}, },
getAsync: function Dict_getAsync(key1, key2, key3) { getAsync: function Dict_getAsync(key1, key2, key3) {
var value; var value;
var xref = this.xref, var xref = this.xref,
suppressEncryption = this.suppressEncryption; suppressEncryption = this.suppressEncryption;
if (typeof (value = this.map[key1]) !== 'undefined' || key1 in this.map || typeof key2 === 'undefined') { if (typeof (value = this._map[key1]) !== 'undefined' || key1 in this._map || typeof key2 === 'undefined') {
if (xref) { if (xref) {
return xref.fetchIfRefAsync(value, suppressEncryption); return xref.fetchIfRefAsync(value, suppressEncryption);
} }
return Promise.resolve(value); return Promise.resolve(value);
} }
if (typeof (value = this.map[key2]) !== 'undefined' || key2 in this.map || typeof key3 === 'undefined') { if (typeof (value = this._map[key2]) !== 'undefined' || key2 in this._map || typeof key3 === 'undefined') {
if (xref) { if (xref) {
return xref.fetchIfRefAsync(value, suppressEncryption); return xref.fetchIfRefAsync(value, suppressEncryption);
} }
return Promise.resolve(value); return Promise.resolve(value);
} }
value = this.map[key3] || null; value = this._map[key3] || null;
if (xref) { if (xref) {
return xref.fetchIfRefAsync(value, suppressEncryption); return xref.fetchIfRefAsync(value, suppressEncryption);
} }
@ -1544,36 +1544,36 @@ var Dict = function DictClosure() {
return value; return value;
}, },
getRaw: function Dict_getRaw(key) { getRaw: function Dict_getRaw(key) {
return this.map[key]; return this._map[key];
}, },
getKeys: function Dict_getKeys() { getKeys: function Dict_getKeys() {
return Object.keys(this.map); return Object.keys(this._map);
}, },
set: function Dict_set(key, value) { set: function Dict_set(key, value) {
this.map[key] = value; this._map[key] = value;
}, },
has: function Dict_has(key) { has: function Dict_has(key) {
return key in this.map; return key in this._map;
}, },
forEach: function Dict_forEach(callback) { forEach: function Dict_forEach(callback) {
for (var key in this.map) { for (var key in this._map) {
callback(key, this.get(key)); callback(key, this.get(key));
} }
} }
}; };
Dict.empty = new Dict(null); Dict.empty = new Dict(null);
Dict.merge = function Dict_merge(xref, dictArray) { Dict.merge = function (xref, dictArray) {
var mergedDict = new Dict(xref); var mergedDict = new Dict(xref);
for (var i = 0, ii = dictArray.length; i < ii; i++) { for (var i = 0, ii = dictArray.length; i < ii; i++) {
var dict = dictArray[i]; var dict = dictArray[i];
if (!isDict(dict)) { if (!isDict(dict)) {
continue; continue;
} }
for (var keyName in dict.map) { for (var keyName in dict._map) {
if (mergedDict.map[keyName]) { if (mergedDict._map[keyName] !== undefined) {
continue; continue;
} }
mergedDict.map[keyName] = dict.map[keyName]; mergedDict._map[keyName] = dict._map[keyName];
} }
} }
return mergedDict; return mergedDict;
@ -13077,8 +13077,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
}(); }();
var version, build; var version, build;
{ {
exports.version = version = '1.8.458'; exports.version = version = '1.8.462';
exports.build = build = 'a6311471'; exports.build = build = 'db52e4fb';
} }
exports.getDocument = getDocument; exports.getDocument = getDocument;
exports.LoopbackPort = LoopbackPort; exports.LoopbackPort = LoopbackPort;
@ -24642,53 +24642,53 @@ var ObjectLoader = function () {
return (0, _primitives.isRef)(value) || (0, _primitives.isDict)(value) || (0, _util.isArray)(value) || (0, _primitives.isStream)(value); return (0, _primitives.isRef)(value) || (0, _primitives.isDict)(value) || (0, _util.isArray)(value) || (0, _primitives.isStream)(value);
} }
function addChildren(node, nodesToVisit) { function addChildren(node, nodesToVisit) {
var value;
if ((0, _primitives.isDict)(node) || (0, _primitives.isStream)(node)) { if ((0, _primitives.isDict)(node) || (0, _primitives.isStream)(node)) {
var map; var dict = (0, _primitives.isDict)(node) ? node : node.dict;
if ((0, _primitives.isDict)(node)) { var dictKeys = dict.getKeys();
map = node.map; for (var i = 0, ii = dictKeys.length; i < ii; i++) {
} else { var rawValue = dict.getRaw(dictKeys[i]);
map = node.dict.map; if (mayHaveChildren(rawValue)) {
} nodesToVisit.push(rawValue);
for (var key in map) {
value = map[key];
if (mayHaveChildren(value)) {
nodesToVisit.push(value);
} }
} }
} else if ((0, _util.isArray)(node)) { } else if ((0, _util.isArray)(node)) {
for (var i = 0, ii = node.length; i < ii; i++) { for (var _i = 0, _ii = node.length; _i < _ii; _i++) {
value = node[i]; var value = node[_i];
if (mayHaveChildren(value)) { if (mayHaveChildren(value)) {
nodesToVisit.push(value); nodesToVisit.push(value);
} }
} }
} }
} }
function ObjectLoader(obj, keys, xref) { function ObjectLoader(dict, keys, xref) {
this.obj = obj; this.dict = dict;
this.keys = keys; this.keys = keys;
this.xref = xref; this.xref = xref;
this.refSet = null; this.refSet = null;
this.capability = null; this.capability = null;
} }
ObjectLoader.prototype = { ObjectLoader.prototype = {
load: function ObjectLoader_load() { load: function load() {
var keys = this.keys;
this.capability = (0, _util.createPromiseCapability)(); this.capability = (0, _util.createPromiseCapability)();
if (!(this.xref.stream instanceof _chunked_stream.ChunkedStream) || this.xref.stream.getMissingChunks().length === 0) { if (!(this.xref.stream instanceof _chunked_stream.ChunkedStream) || this.xref.stream.getMissingChunks().length === 0) {
this.capability.resolve(); this.capability.resolve();
return this.capability.promise; return this.capability.promise;
} }
var keys = this.keys,
dict = this.dict;
this.refSet = new _primitives.RefSet(); this.refSet = new _primitives.RefSet();
var nodesToVisit = []; var nodesToVisit = [];
for (var i = 0; i < keys.length; i++) { for (var i = 0, ii = keys.length; i < ii; i++) {
nodesToVisit.push(this.obj[keys[i]]); var rawValue = dict.getRaw(keys[i]);
if (rawValue !== undefined) {
nodesToVisit.push(rawValue);
}
} }
this._walk(nodesToVisit); this._walk(nodesToVisit);
return this.capability.promise; return this.capability.promise;
}, },
_walk: function ObjectLoader_walk(nodesToVisit) { _walk: function _walk(nodesToVisit) {
var _this3 = this; var _this3 = this;
var nodesToRevisit = []; var nodesToRevisit = [];
@ -24700,24 +24700,23 @@ var ObjectLoader = function () {
continue; continue;
} }
try { try {
var ref = currentNode; this.refSet.put(currentNode);
this.refSet.put(ref);
currentNode = this.xref.fetch(currentNode); currentNode = this.xref.fetch(currentNode);
} catch (e) { } catch (ex) {
if (!(e instanceof _util.MissingDataException)) { if (!(ex instanceof _util.MissingDataException)) {
throw e; throw ex;
} }
nodesToRevisit.push(currentNode); nodesToRevisit.push(currentNode);
pendingRequests.push({ pendingRequests.push({
begin: e.begin, begin: ex.begin,
end: e.end end: ex.end
}); });
} }
} }
if (currentNode && currentNode.getBaseStreams) { if (currentNode && currentNode.getBaseStreams) {
var baseStreams = currentNode.getBaseStreams(); var baseStreams = currentNode.getBaseStreams();
var foundMissingData = false; var foundMissingData = false;
for (var i = 0; i < baseStreams.length; i++) { for (var i = 0, ii = baseStreams.length; i < ii; i++) {
var stream = baseStreams[i]; var stream = baseStreams[i];
if (stream.getMissingChunks && stream.getMissingChunks().length) { if (stream.getMissingChunks && stream.getMissingChunks().length) {
foundMissingData = true; foundMissingData = true;
@ -24735,14 +24734,13 @@ var ObjectLoader = function () {
} }
if (pendingRequests.length) { if (pendingRequests.length) {
this.xref.stream.manager.requestRanges(pendingRequests).then(function () { this.xref.stream.manager.requestRanges(pendingRequests).then(function () {
nodesToVisit = nodesToRevisit; for (var _i2 = 0, _ii2 = nodesToRevisit.length; _i2 < _ii2; _i2++) {
for (var i = 0; i < nodesToRevisit.length; i++) { var node = nodesToRevisit[_i2];
var node = nodesToRevisit[i];
if ((0, _primitives.isRef)(node)) { if ((0, _primitives.isRef)(node)) {
_this3.refSet.remove(node); _this3.refSet.remove(node);
} }
} }
_this3._walk(nodesToVisit); _this3._walk(nodesToRevisit);
}, this.capability.reject); }, this.capability.reject);
return; return;
} }
@ -28427,8 +28425,8 @@ if (!_util.globalScope.PDFJS) {
} }
var PDFJS = _util.globalScope.PDFJS; var PDFJS = _util.globalScope.PDFJS;
{ {
PDFJS.version = '1.8.458'; PDFJS.version = '1.8.462';
PDFJS.build = 'a6311471'; PDFJS.build = 'db52e4fb';
} }
PDFJS.pdfBug = false; PDFJS.pdfBug = false;
if (PDFJS.verbosity !== undefined) { if (PDFJS.verbosity !== undefined) {
@ -31790,7 +31788,7 @@ var Annotation = function AnnotationClosure() {
if (!resources) { if (!resources) {
return; return;
} }
var objectLoader = new _obj.ObjectLoader(resources.map, keys, resources.xref); var objectLoader = new _obj.ObjectLoader(resources, keys, resources.xref);
return objectLoader.load().then(function () { return objectLoader.load().then(function () {
return resources; return resources;
}); });
@ -33335,7 +33333,7 @@ var Page = function PageClosure() {
this.resourcesPromise = this.pdfManager.ensure(this, 'resources'); this.resourcesPromise = this.pdfManager.ensure(this, 'resources');
} }
return this.resourcesPromise.then(function () { return this.resourcesPromise.then(function () {
var objectLoader = new _obj.ObjectLoader(_this.resources.map, keys, _this.xref); var objectLoader = new _obj.ObjectLoader(_this.resources, keys, _this.xref);
return objectLoader.load(); return objectLoader.load();
}); });
}, },
@ -47045,8 +47043,8 @@ exports.TilingPattern = TilingPattern;
"use strict"; "use strict";
var pdfjsVersion = '1.8.458'; var pdfjsVersion = '1.8.462';
var pdfjsBuild = 'a6311471'; var pdfjsBuild = 'db52e4fb';
var pdfjsSharedUtil = __w_pdfjs_require__(0); var pdfjsSharedUtil = __w_pdfjs_require__(0);
var pdfjsDisplayGlobal = __w_pdfjs_require__(26); var pdfjsDisplayGlobal = __w_pdfjs_require__(26);
var pdfjsDisplayAPI = __w_pdfjs_require__(10); var pdfjsDisplayAPI = __w_pdfjs_require__(10);

2
build/pdf.combined.js.map

File diff suppressed because one or more lines are too long

12
build/pdf.js

@ -3806,8 +3806,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
}(); }();
var version, build; var version, build;
{ {
exports.version = version = '1.8.458'; exports.version = version = '1.8.462';
exports.build = build = 'a6311471'; exports.build = build = 'db52e4fb';
} }
exports.getDocument = getDocument; exports.getDocument = getDocument;
exports.LoopbackPort = LoopbackPort; exports.LoopbackPort = LoopbackPort;
@ -5780,8 +5780,8 @@ if (!_util.globalScope.PDFJS) {
} }
var PDFJS = _util.globalScope.PDFJS; var PDFJS = _util.globalScope.PDFJS;
{ {
PDFJS.version = '1.8.458'; PDFJS.version = '1.8.462';
PDFJS.build = 'a6311471'; PDFJS.build = 'db52e4fb';
} }
PDFJS.pdfBug = false; PDFJS.pdfBug = false;
if (PDFJS.verbosity !== undefined) { if (PDFJS.verbosity !== undefined) {
@ -11320,8 +11320,8 @@ exports.TilingPattern = TilingPattern;
"use strict"; "use strict";
var pdfjsVersion = '1.8.458'; var pdfjsVersion = '1.8.462';
var pdfjsBuild = 'a6311471'; var pdfjsBuild = 'db52e4fb';
var pdfjsSharedUtil = __w_pdfjs_require__(0); var pdfjsSharedUtil = __w_pdfjs_require__(0);
var pdfjsDisplayGlobal = __w_pdfjs_require__(9); var pdfjsDisplayGlobal = __w_pdfjs_require__(9);
var pdfjsDisplayAPI = __w_pdfjs_require__(3); var pdfjsDisplayAPI = __w_pdfjs_require__(3);

2
build/pdf.js.map

File diff suppressed because one or more lines are too long

4
build/pdf.min.js vendored

File diff suppressed because one or more lines are too long

102
build/pdf.worker.js vendored

@ -1482,7 +1482,7 @@ var Dict = function DictClosure() {
return nonSerializable; return nonSerializable;
}; };
function Dict(xref) { function Dict(xref) {
this.map = Object.create(null); this._map = Object.create(null);
this.xref = xref; this.xref = xref;
this.objId = null; this.objId = null;
this.suppressEncryption = false; this.suppressEncryption = false;
@ -1496,32 +1496,32 @@ var Dict = function DictClosure() {
var value; var value;
var xref = this.xref, var xref = this.xref,
suppressEncryption = this.suppressEncryption; suppressEncryption = this.suppressEncryption;
if (typeof (value = this.map[key1]) !== 'undefined' || key1 in this.map || typeof key2 === 'undefined') { if (typeof (value = this._map[key1]) !== 'undefined' || key1 in this._map || typeof key2 === 'undefined') {
return xref ? xref.fetchIfRef(value, suppressEncryption) : value; return xref ? xref.fetchIfRef(value, suppressEncryption) : value;
} }
if (typeof (value = this.map[key2]) !== 'undefined' || key2 in this.map || typeof key3 === 'undefined') { if (typeof (value = this._map[key2]) !== 'undefined' || key2 in this._map || typeof key3 === 'undefined') {
return xref ? xref.fetchIfRef(value, suppressEncryption) : value; return xref ? xref.fetchIfRef(value, suppressEncryption) : value;
} }
value = this.map[key3] || null; value = this._map[key3] || null;
return xref ? xref.fetchIfRef(value, suppressEncryption) : value; return xref ? xref.fetchIfRef(value, suppressEncryption) : value;
}, },
getAsync: function Dict_getAsync(key1, key2, key3) { getAsync: function Dict_getAsync(key1, key2, key3) {
var value; var value;
var xref = this.xref, var xref = this.xref,
suppressEncryption = this.suppressEncryption; suppressEncryption = this.suppressEncryption;
if (typeof (value = this.map[key1]) !== 'undefined' || key1 in this.map || typeof key2 === 'undefined') { if (typeof (value = this._map[key1]) !== 'undefined' || key1 in this._map || typeof key2 === 'undefined') {
if (xref) { if (xref) {
return xref.fetchIfRefAsync(value, suppressEncryption); return xref.fetchIfRefAsync(value, suppressEncryption);
} }
return Promise.resolve(value); return Promise.resolve(value);
} }
if (typeof (value = this.map[key2]) !== 'undefined' || key2 in this.map || typeof key3 === 'undefined') { if (typeof (value = this._map[key2]) !== 'undefined' || key2 in this._map || typeof key3 === 'undefined') {
if (xref) { if (xref) {
return xref.fetchIfRefAsync(value, suppressEncryption); return xref.fetchIfRefAsync(value, suppressEncryption);
} }
return Promise.resolve(value); return Promise.resolve(value);
} }
value = this.map[key3] || null; value = this._map[key3] || null;
if (xref) { if (xref) {
return xref.fetchIfRefAsync(value, suppressEncryption); return xref.fetchIfRefAsync(value, suppressEncryption);
} }
@ -1544,36 +1544,36 @@ var Dict = function DictClosure() {
return value; return value;
}, },
getRaw: function Dict_getRaw(key) { getRaw: function Dict_getRaw(key) {
return this.map[key]; return this._map[key];
}, },
getKeys: function Dict_getKeys() { getKeys: function Dict_getKeys() {
return Object.keys(this.map); return Object.keys(this._map);
}, },
set: function Dict_set(key, value) { set: function Dict_set(key, value) {
this.map[key] = value; this._map[key] = value;
}, },
has: function Dict_has(key) { has: function Dict_has(key) {
return key in this.map; return key in this._map;
}, },
forEach: function Dict_forEach(callback) { forEach: function Dict_forEach(callback) {
for (var key in this.map) { for (var key in this._map) {
callback(key, this.get(key)); callback(key, this.get(key));
} }
} }
}; };
Dict.empty = new Dict(null); Dict.empty = new Dict(null);
Dict.merge = function Dict_merge(xref, dictArray) { Dict.merge = function (xref, dictArray) {
var mergedDict = new Dict(xref); var mergedDict = new Dict(xref);
for (var i = 0, ii = dictArray.length; i < ii; i++) { for (var i = 0, ii = dictArray.length; i < ii; i++) {
var dict = dictArray[i]; var dict = dictArray[i];
if (!isDict(dict)) { if (!isDict(dict)) {
continue; continue;
} }
for (var keyName in dict.map) { for (var keyName in dict._map) {
if (mergedDict.map[keyName]) { if (mergedDict._map[keyName] !== undefined) {
continue; continue;
} }
mergedDict.map[keyName] = dict.map[keyName]; mergedDict._map[keyName] = dict._map[keyName];
} }
} }
return mergedDict; return mergedDict;
@ -21594,53 +21594,53 @@ var ObjectLoader = function () {
return (0, _primitives.isRef)(value) || (0, _primitives.isDict)(value) || (0, _util.isArray)(value) || (0, _primitives.isStream)(value); return (0, _primitives.isRef)(value) || (0, _primitives.isDict)(value) || (0, _util.isArray)(value) || (0, _primitives.isStream)(value);
} }
function addChildren(node, nodesToVisit) { function addChildren(node, nodesToVisit) {
var value;
if ((0, _primitives.isDict)(node) || (0, _primitives.isStream)(node)) { if ((0, _primitives.isDict)(node) || (0, _primitives.isStream)(node)) {
var map; var dict = (0, _primitives.isDict)(node) ? node : node.dict;
if ((0, _primitives.isDict)(node)) { var dictKeys = dict.getKeys();
map = node.map; for (var i = 0, ii = dictKeys.length; i < ii; i++) {
} else { var rawValue = dict.getRaw(dictKeys[i]);
map = node.dict.map; if (mayHaveChildren(rawValue)) {
} nodesToVisit.push(rawValue);
for (var key in map) {
value = map[key];
if (mayHaveChildren(value)) {
nodesToVisit.push(value);
} }
} }
} else if ((0, _util.isArray)(node)) { } else if ((0, _util.isArray)(node)) {
for (var i = 0, ii = node.length; i < ii; i++) { for (var _i = 0, _ii = node.length; _i < _ii; _i++) {
value = node[i]; var value = node[_i];
if (mayHaveChildren(value)) { if (mayHaveChildren(value)) {
nodesToVisit.push(value); nodesToVisit.push(value);
} }
} }
} }
} }
function ObjectLoader(obj, keys, xref) { function ObjectLoader(dict, keys, xref) {
this.obj = obj; this.dict = dict;
this.keys = keys; this.keys = keys;
this.xref = xref; this.xref = xref;
this.refSet = null; this.refSet = null;
this.capability = null; this.capability = null;
} }
ObjectLoader.prototype = { ObjectLoader.prototype = {
load: function ObjectLoader_load() { load: function load() {
var keys = this.keys;
this.capability = (0, _util.createPromiseCapability)(); this.capability = (0, _util.createPromiseCapability)();
if (!(this.xref.stream instanceof _chunked_stream.ChunkedStream) || this.xref.stream.getMissingChunks().length === 0) { if (!(this.xref.stream instanceof _chunked_stream.ChunkedStream) || this.xref.stream.getMissingChunks().length === 0) {
this.capability.resolve(); this.capability.resolve();
return this.capability.promise; return this.capability.promise;
} }
var keys = this.keys,
dict = this.dict;
this.refSet = new _primitives.RefSet(); this.refSet = new _primitives.RefSet();
var nodesToVisit = []; var nodesToVisit = [];
for (var i = 0; i < keys.length; i++) { for (var i = 0, ii = keys.length; i < ii; i++) {
nodesToVisit.push(this.obj[keys[i]]); var rawValue = dict.getRaw(keys[i]);
if (rawValue !== undefined) {
nodesToVisit.push(rawValue);
}
} }
this._walk(nodesToVisit); this._walk(nodesToVisit);
return this.capability.promise; return this.capability.promise;
}, },
_walk: function ObjectLoader_walk(nodesToVisit) { _walk: function _walk(nodesToVisit) {
var _this3 = this; var _this3 = this;
var nodesToRevisit = []; var nodesToRevisit = [];
@ -21652,24 +21652,23 @@ var ObjectLoader = function () {
continue; continue;
} }
try { try {
var ref = currentNode; this.refSet.put(currentNode);
this.refSet.put(ref);
currentNode = this.xref.fetch(currentNode); currentNode = this.xref.fetch(currentNode);
} catch (e) { } catch (ex) {
if (!(e instanceof _util.MissingDataException)) { if (!(ex instanceof _util.MissingDataException)) {
throw e; throw ex;
} }
nodesToRevisit.push(currentNode); nodesToRevisit.push(currentNode);
pendingRequests.push({ pendingRequests.push({
begin: e.begin, begin: ex.begin,
end: e.end end: ex.end
}); });
} }
} }
if (currentNode && currentNode.getBaseStreams) { if (currentNode && currentNode.getBaseStreams) {
var baseStreams = currentNode.getBaseStreams(); var baseStreams = currentNode.getBaseStreams();
var foundMissingData = false; var foundMissingData = false;
for (var i = 0; i < baseStreams.length; i++) { for (var i = 0, ii = baseStreams.length; i < ii; i++) {
var stream = baseStreams[i]; var stream = baseStreams[i];
if (stream.getMissingChunks && stream.getMissingChunks().length) { if (stream.getMissingChunks && stream.getMissingChunks().length) {
foundMissingData = true; foundMissingData = true;
@ -21687,14 +21686,13 @@ var ObjectLoader = function () {
} }
if (pendingRequests.length) { if (pendingRequests.length) {
this.xref.stream.manager.requestRanges(pendingRequests).then(function () { this.xref.stream.manager.requestRanges(pendingRequests).then(function () {
nodesToVisit = nodesToRevisit; for (var _i2 = 0, _ii2 = nodesToRevisit.length; _i2 < _ii2; _i2++) {
for (var i = 0; i < nodesToRevisit.length; i++) { var node = nodesToRevisit[_i2];
var node = nodesToRevisit[i];
if ((0, _primitives.isRef)(node)) { if ((0, _primitives.isRef)(node)) {
_this3.refSet.remove(node); _this3.refSet.remove(node);
} }
} }
_this3._walk(nodesToVisit); _this3._walk(nodesToRevisit);
}, this.capability.reject); }, this.capability.reject);
return; return;
} }
@ -27966,7 +27964,7 @@ var Annotation = function AnnotationClosure() {
if (!resources) { if (!resources) {
return; return;
} }
var objectLoader = new _obj.ObjectLoader(resources.map, keys, resources.xref); var objectLoader = new _obj.ObjectLoader(resources, keys, resources.xref);
return objectLoader.load().then(function () { return objectLoader.load().then(function () {
return resources; return resources;
}); });
@ -29511,7 +29509,7 @@ var Page = function PageClosure() {
this.resourcesPromise = this.pdfManager.ensure(this, 'resources'); this.resourcesPromise = this.pdfManager.ensure(this, 'resources');
} }
return this.resourcesPromise.then(function () { return this.resourcesPromise.then(function () {
var objectLoader = new _obj.ObjectLoader(_this.resources.map, keys, _this.xref); var objectLoader = new _obj.ObjectLoader(_this.resources, keys, _this.xref);
return objectLoader.load(); return objectLoader.load();
}); });
}, },
@ -40319,8 +40317,8 @@ exports.Type1Parser = Type1Parser;
"use strict"; "use strict";
var pdfjsVersion = '1.8.458'; var pdfjsVersion = '1.8.462';
var pdfjsBuild = 'a6311471'; var pdfjsBuild = 'db52e4fb';
var pdfjsCoreWorker = __w_pdfjs_require__(8); var pdfjsCoreWorker = __w_pdfjs_require__(8);
{ {
__w_pdfjs_require__(19); __w_pdfjs_require__(19);

2
build/pdf.worker.js.map vendored

File diff suppressed because one or more lines are too long

36
build/pdf.worker.min.js vendored

File diff suppressed because one or more lines are too long

2
lib/core/annotation.js

@ -243,7 +243,7 @@ var Annotation = function AnnotationClosure() {
if (!resources) { if (!resources) {
return; return;
} }
var objectLoader = new _obj.ObjectLoader(resources.map, keys, resources.xref); var objectLoader = new _obj.ObjectLoader(resources, keys, resources.xref);
return objectLoader.load().then(function () { return objectLoader.load().then(function () {
return resources; return resources;
}); });

2
lib/core/document.js

@ -166,7 +166,7 @@ var Page = function PageClosure() {
this.resourcesPromise = this.pdfManager.ensure(this, 'resources'); this.resourcesPromise = this.pdfManager.ensure(this, 'resources');
} }
return this.resourcesPromise.then(function () { return this.resourcesPromise.then(function () {
var objectLoader = new _obj.ObjectLoader(_this.resources.map, keys, _this.xref); var objectLoader = new _obj.ObjectLoader(_this.resources, keys, _this.xref);
return objectLoader.load(); return objectLoader.load();
}); });
}, },

62
lib/core/obj.js

@ -1340,53 +1340,53 @@ var ObjectLoader = function () {
return (0, _primitives.isRef)(value) || (0, _primitives.isDict)(value) || (0, _util.isArray)(value) || (0, _primitives.isStream)(value); return (0, _primitives.isRef)(value) || (0, _primitives.isDict)(value) || (0, _util.isArray)(value) || (0, _primitives.isStream)(value);
} }
function addChildren(node, nodesToVisit) { function addChildren(node, nodesToVisit) {
var value;
if ((0, _primitives.isDict)(node) || (0, _primitives.isStream)(node)) { if ((0, _primitives.isDict)(node) || (0, _primitives.isStream)(node)) {
var map; var dict = (0, _primitives.isDict)(node) ? node : node.dict;
if ((0, _primitives.isDict)(node)) { var dictKeys = dict.getKeys();
map = node.map; for (var i = 0, ii = dictKeys.length; i < ii; i++) {
} else { var rawValue = dict.getRaw(dictKeys[i]);
map = node.dict.map; if (mayHaveChildren(rawValue)) {
} nodesToVisit.push(rawValue);
for (var key in map) {
value = map[key];
if (mayHaveChildren(value)) {
nodesToVisit.push(value);
} }
} }
} else if ((0, _util.isArray)(node)) { } else if ((0, _util.isArray)(node)) {
for (var i = 0, ii = node.length; i < ii; i++) { for (var _i = 0, _ii = node.length; _i < _ii; _i++) {
value = node[i]; var value = node[_i];
if (mayHaveChildren(value)) { if (mayHaveChildren(value)) {
nodesToVisit.push(value); nodesToVisit.push(value);
} }
} }
} }
} }
function ObjectLoader(obj, keys, xref) { function ObjectLoader(dict, keys, xref) {
this.obj = obj; this.dict = dict;
this.keys = keys; this.keys = keys;
this.xref = xref; this.xref = xref;
this.refSet = null; this.refSet = null;
this.capability = null; this.capability = null;
} }
ObjectLoader.prototype = { ObjectLoader.prototype = {
load: function ObjectLoader_load() { load: function load() {
var keys = this.keys;
this.capability = (0, _util.createPromiseCapability)(); this.capability = (0, _util.createPromiseCapability)();
if (!(this.xref.stream instanceof _chunked_stream.ChunkedStream) || this.xref.stream.getMissingChunks().length === 0) { if (!(this.xref.stream instanceof _chunked_stream.ChunkedStream) || this.xref.stream.getMissingChunks().length === 0) {
this.capability.resolve(); this.capability.resolve();
return this.capability.promise; return this.capability.promise;
} }
var keys = this.keys,
dict = this.dict;
this.refSet = new _primitives.RefSet(); this.refSet = new _primitives.RefSet();
var nodesToVisit = []; var nodesToVisit = [];
for (var i = 0; i < keys.length; i++) { for (var i = 0, ii = keys.length; i < ii; i++) {
nodesToVisit.push(this.obj[keys[i]]); var rawValue = dict.getRaw(keys[i]);
if (rawValue !== undefined) {
nodesToVisit.push(rawValue);
}
} }
this._walk(nodesToVisit); this._walk(nodesToVisit);
return this.capability.promise; return this.capability.promise;
}, },
_walk: function ObjectLoader_walk(nodesToVisit) { _walk: function _walk(nodesToVisit) {
var _this3 = this; var _this3 = this;
var nodesToRevisit = []; var nodesToRevisit = [];
@ -1398,24 +1398,23 @@ var ObjectLoader = function () {
continue; continue;
} }
try { try {
var ref = currentNode; this.refSet.put(currentNode);
this.refSet.put(ref);
currentNode = this.xref.fetch(currentNode); currentNode = this.xref.fetch(currentNode);
} catch (e) { } catch (ex) {
if (!(e instanceof _util.MissingDataException)) { if (!(ex instanceof _util.MissingDataException)) {
throw e; throw ex;
} }
nodesToRevisit.push(currentNode); nodesToRevisit.push(currentNode);
pendingRequests.push({ pendingRequests.push({
begin: e.begin, begin: ex.begin,
end: e.end end: ex.end
}); });
} }
} }
if (currentNode && currentNode.getBaseStreams) { if (currentNode && currentNode.getBaseStreams) {
var baseStreams = currentNode.getBaseStreams(); var baseStreams = currentNode.getBaseStreams();
var foundMissingData = false; var foundMissingData = false;
for (var i = 0; i < baseStreams.length; i++) { for (var i = 0, ii = baseStreams.length; i < ii; i++) {
var stream = baseStreams[i]; var stream = baseStreams[i];
if (stream.getMissingChunks && stream.getMissingChunks().length) { if (stream.getMissingChunks && stream.getMissingChunks().length) {
foundMissingData = true; foundMissingData = true;
@ -1433,14 +1432,13 @@ var ObjectLoader = function () {
} }
if (pendingRequests.length) { if (pendingRequests.length) {
this.xref.stream.manager.requestRanges(pendingRequests).then(function () { this.xref.stream.manager.requestRanges(pendingRequests).then(function () {
nodesToVisit = nodesToRevisit; for (var _i2 = 0, _ii2 = nodesToRevisit.length; _i2 < _ii2; _i2++) {
for (var i = 0; i < nodesToRevisit.length; i++) { var node = nodesToRevisit[_i2];
var node = nodesToRevisit[i];
if ((0, _primitives.isRef)(node)) { if ((0, _primitives.isRef)(node)) {
_this3.refSet.remove(node); _this3.refSet.remove(node);
} }
} }
_this3._walk(nodesToVisit); _this3._walk(nodesToRevisit);
}, this.capability.reject); }, this.capability.reject);
return; return;
} }

32
lib/core/primitives.js

@ -53,7 +53,7 @@ var Dict = function DictClosure() {
return nonSerializable; return nonSerializable;
}; };
function Dict(xref) { function Dict(xref) {
this.map = Object.create(null); this._map = Object.create(null);
this.xref = xref; this.xref = xref;
this.objId = null; this.objId = null;
this.suppressEncryption = false; this.suppressEncryption = false;
@ -67,32 +67,32 @@ var Dict = function DictClosure() {
var value; var value;
var xref = this.xref, var xref = this.xref,
suppressEncryption = this.suppressEncryption; suppressEncryption = this.suppressEncryption;
if (typeof (value = this.map[key1]) !== 'undefined' || key1 in this.map || typeof key2 === 'undefined') { if (typeof (value = this._map[key1]) !== 'undefined' || key1 in this._map || typeof key2 === 'undefined') {
return xref ? xref.fetchIfRef(value, suppressEncryption) : value; return xref ? xref.fetchIfRef(value, suppressEncryption) : value;
} }
if (typeof (value = this.map[key2]) !== 'undefined' || key2 in this.map || typeof key3 === 'undefined') { if (typeof (value = this._map[key2]) !== 'undefined' || key2 in this._map || typeof key3 === 'undefined') {
return xref ? xref.fetchIfRef(value, suppressEncryption) : value; return xref ? xref.fetchIfRef(value, suppressEncryption) : value;
} }
value = this.map[key3] || null; value = this._map[key3] || null;
return xref ? xref.fetchIfRef(value, suppressEncryption) : value; return xref ? xref.fetchIfRef(value, suppressEncryption) : value;
}, },
getAsync: function Dict_getAsync(key1, key2, key3) { getAsync: function Dict_getAsync(key1, key2, key3) {
var value; var value;
var xref = this.xref, var xref = this.xref,
suppressEncryption = this.suppressEncryption; suppressEncryption = this.suppressEncryption;
if (typeof (value = this.map[key1]) !== 'undefined' || key1 in this.map || typeof key2 === 'undefined') { if (typeof (value = this._map[key1]) !== 'undefined' || key1 in this._map || typeof key2 === 'undefined') {
if (xref) { if (xref) {
return xref.fetchIfRefAsync(value, suppressEncryption); return xref.fetchIfRefAsync(value, suppressEncryption);
} }
return Promise.resolve(value); return Promise.resolve(value);
} }
if (typeof (value = this.map[key2]) !== 'undefined' || key2 in this.map || typeof key3 === 'undefined') { if (typeof (value = this._map[key2]) !== 'undefined' || key2 in this._map || typeof key3 === 'undefined') {
if (xref) { if (xref) {
return xref.fetchIfRefAsync(value, suppressEncryption); return xref.fetchIfRefAsync(value, suppressEncryption);
} }
return Promise.resolve(value); return Promise.resolve(value);
} }
value = this.map[key3] || null; value = this._map[key3] || null;
if (xref) { if (xref) {
return xref.fetchIfRefAsync(value, suppressEncryption); return xref.fetchIfRefAsync(value, suppressEncryption);
} }
@ -115,36 +115,36 @@ var Dict = function DictClosure() {
return value; return value;
}, },
getRaw: function Dict_getRaw(key) { getRaw: function Dict_getRaw(key) {
return this.map[key]; return this._map[key];
}, },
getKeys: function Dict_getKeys() { getKeys: function Dict_getKeys() {
return Object.keys(this.map); return Object.keys(this._map);
}, },
set: function Dict_set(key, value) { set: function Dict_set(key, value) {
this.map[key] = value; this._map[key] = value;
}, },
has: function Dict_has(key) { has: function Dict_has(key) {
return key in this.map; return key in this._map;
}, },
forEach: function Dict_forEach(callback) { forEach: function Dict_forEach(callback) {
for (var key in this.map) { for (var key in this._map) {
callback(key, this.get(key)); callback(key, this.get(key));
} }
} }
}; };
Dict.empty = new Dict(null); Dict.empty = new Dict(null);
Dict.merge = function Dict_merge(xref, dictArray) { Dict.merge = function (xref, dictArray) {
var mergedDict = new Dict(xref); var mergedDict = new Dict(xref);
for (var i = 0, ii = dictArray.length; i < ii; i++) { for (var i = 0, ii = dictArray.length; i < ii; i++) {
var dict = dictArray[i]; var dict = dictArray[i];
if (!isDict(dict)) { if (!isDict(dict)) {
continue; continue;
} }
for (var keyName in dict.map) { for (var keyName in dict._map) {
if (mergedDict.map[keyName]) { if (mergedDict._map[keyName] !== undefined) {
continue; continue;
} }
mergedDict.map[keyName] = dict.map[keyName]; mergedDict._map[keyName] = dict._map[keyName];
} }
} }
return mergedDict; return mergedDict;

4
lib/display/api.js

@ -1443,8 +1443,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
}(); }();
var version, build; var version, build;
{ {
exports.version = version = '1.8.458'; exports.version = version = '1.8.462';
exports.build = build = 'a6311471'; exports.build = build = 'db52e4fb';
} }
exports.getDocument = getDocument; exports.getDocument = getDocument;
exports.LoopbackPort = LoopbackPort; exports.LoopbackPort = LoopbackPort;

4
lib/display/global.js

@ -39,8 +39,8 @@ if (!_util.globalScope.PDFJS) {
} }
var PDFJS = _util.globalScope.PDFJS; var PDFJS = _util.globalScope.PDFJS;
{ {
PDFJS.version = '1.8.458'; PDFJS.version = '1.8.462';
PDFJS.build = 'a6311471'; PDFJS.build = 'db52e4fb';
} }
PDFJS.pdfBug = false; PDFJS.pdfBug = false;
if (PDFJS.verbosity !== undefined) { if (PDFJS.verbosity !== undefined) {

4
lib/pdf.js

@ -14,8 +14,8 @@
*/ */
'use strict'; 'use strict';
var pdfjsVersion = '1.8.458'; var pdfjsVersion = '1.8.462';
var pdfjsBuild = 'a6311471'; var pdfjsBuild = 'db52e4fb';
var pdfjsSharedUtil = require('./shared/util.js'); var pdfjsSharedUtil = require('./shared/util.js');
var pdfjsDisplayGlobal = require('./display/global.js'); var pdfjsDisplayGlobal = require('./display/global.js');
var pdfjsDisplayAPI = require('./display/api.js'); var pdfjsDisplayAPI = require('./display/api.js');

4
lib/pdf.worker.js vendored

@ -14,8 +14,8 @@
*/ */
'use strict'; 'use strict';
var pdfjsVersion = '1.8.458'; var pdfjsVersion = '1.8.462';
var pdfjsBuild = 'a6311471'; var pdfjsBuild = 'db52e4fb';
var pdfjsCoreWorker = require('./core/worker.js'); var pdfjsCoreWorker = require('./core/worker.js');
{ {
require('./core/network.js'); require('./core/network.js');

2
package.json

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

Loading…
Cancel
Save