Browse Source

PDF.js version 1.6.242 - See mozilla/pdf.js@ea5949f1fd8aca03e2f9571ccf7a6cd2bf49836e

master v1.6.242
Pdf Bot 8 years ago
parent
commit
5bca74f125
  1. 2
      bower.json
  2. 54
      build/pdf.combined.js
  3. 4
      build/pdf.js
  4. 54
      build/pdf.worker.js
  5. 2
      package.json

2
bower.json

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

54
build/pdf.combined.js

@ -24,8 +24,8 @@
}(this, function (exports) { }(this, function (exports) {
// Use strict in our context only - users might not want it // Use strict in our context only - users might not want it
'use strict'; 'use strict';
var pdfjsVersion = '1.6.239'; var pdfjsVersion = '1.6.242';
var pdfjsBuild = 'f209030'; var pdfjsBuild = 'ea5949f';
var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : null; var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : null;
var pdfjsLibs = {}; var pdfjsLibs = {};
(function pdfjsWrapper() { (function pdfjsWrapper() {
@ -21098,6 +21098,7 @@
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.__nonSerializable__ = nonSerializable; this.__nonSerializable__ = nonSerializable;
} }
// disable cloning of the Dict // disable cloning of the Dict
@ -21108,42 +21109,42 @@
// automatically dereferences Ref objects // automatically dereferences Ref objects
get: function Dict_get(key1, key2, key3) { get: function Dict_get(key1, key2, key3) {
var value; var value;
var xref = this.xref; var xref = this.xref, 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) : 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) : value; return xref ? xref.fetchIfRef(value, suppressEncryption) : value;
} }
value = this.map[key3] || null; value = this.map[key3] || null;
return xref ? xref.fetchIfRef(value) : value; return xref ? xref.fetchIfRef(value, suppressEncryption) : value;
}, },
// Same as get(), but returns a promise and uses fetchIfRefAsync(). // Same as get(), but returns a promise and uses fetchIfRefAsync().
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;
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); 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); 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); return xref.fetchIfRefAsync(value, suppressEncryption);
} }
return Promise.resolve(value); return Promise.resolve(value);
}, },
// Same as get(), but dereferences all elements if the result is an Array. // Same as get(), but dereferences all elements if the result is an Array.
getArray: function Dict_getArray(key1, key2, key3) { getArray: function Dict_getArray(key1, key2, key3) {
var value = this.get(key1, key2, key3); var value = this.get(key1, key2, key3);
var xref = this.xref; var xref = this.xref, suppressEncryption = this.suppressEncryption;
if (!isArray(value) || !xref) { if (!isArray(value) || !xref) {
return value; return value;
} }
@ -21153,7 +21154,7 @@
if (!isRef(value[i])) { if (!isRef(value[i])) {
continue; continue;
} }
value[i] = xref.fetch(value[i]); value[i] = xref.fetch(value[i], suppressEncryption);
} }
return value; return value;
}, },
@ -34454,11 +34455,12 @@
var PasswordException = sharedUtil.PasswordException; var PasswordException = sharedUtil.PasswordException;
var PasswordResponses = sharedUtil.PasswordResponses; var PasswordResponses = sharedUtil.PasswordResponses;
var bytesToString = sharedUtil.bytesToString; var bytesToString = sharedUtil.bytesToString;
var warn = sharedUtil.warn;
var error = sharedUtil.error; var error = sharedUtil.error;
var assert = sharedUtil.assert;
var isInt = sharedUtil.isInt; var isInt = sharedUtil.isInt;
var stringToBytes = sharedUtil.stringToBytes; var stringToBytes = sharedUtil.stringToBytes;
var utf8StringToString = sharedUtil.utf8StringToString; var utf8StringToString = sharedUtil.utf8StringToString;
var warn = sharedUtil.warn;
var Name = corePrimitives.Name; var Name = corePrimitives.Name;
var isName = corePrimitives.isName; var isName = corePrimitives.isName;
var isDict = corePrimitives.isDict; var isDict = corePrimitives.isDict;
@ -38306,6 +38308,8 @@
var cfDict = dict.get('CF'); var cfDict = dict.get('CF');
var streamCryptoName = dict.get('StmF'); var streamCryptoName = dict.get('StmF');
if (isDict(cfDict) && isName(streamCryptoName)) { if (isDict(cfDict) && isName(streamCryptoName)) {
cfDict.suppressEncryption = true;
// See comment below.
var handlerDict = cfDict.get(streamCryptoName.name); var handlerDict = cfDict.get(streamCryptoName.name);
keyLength = handlerDict && handlerDict.get('Length') || 128; keyLength = handlerDict && handlerDict.get('Length') || 128;
if (keyLength < 40) { if (keyLength < 40) {
@ -38364,7 +38368,15 @@
} }
this.encryptionKey = encryptionKey; this.encryptionKey = encryptionKey;
if (algorithm >= 4) { if (algorithm >= 4) {
this.cf = dict.get('CF'); var cf = dict.get('CF');
if (isDict(cf)) {
// The 'CF' dictionary itself should not be encrypted, and by setting
// `suppressEncryption` we can prevent an infinite loop inside of
// `XRef_fetchUncompressed` if the dictionary contains indirect objects
// (fixes issue7665.pdf).
cf.suppressEncryption = true;
}
this.cf = cf;
this.stmf = dict.get('StmF') || identityName; this.stmf = dict.get('StmF') || identityName;
this.strf = dict.get('StrF') || identityName; this.strf = dict.get('StrF') || identityName;
this.eff = dict.get('EFF') || this.stmf; this.eff = dict.get('EFF') || this.stmf;
@ -38390,6 +38402,7 @@
return hash.subarray(0, Math.min(encryptionKey.length + 5, 16)); return hash.subarray(0, Math.min(encryptionKey.length + 5, 16));
} }
function buildCipherConstructor(cf, name, num, gen, key) { function buildCipherConstructor(cf, name, num, gen, key) {
assert(isName(name), 'Invalid crypt filter name.');
var cryptFilter = cf.get(name.name); var cryptFilter = cf.get(name.name);
var cfm; var cfm;
if (cryptFilter !== null && cryptFilter !== undefined) { if (cryptFilter !== null && cryptFilter !== undefined) {
@ -53809,6 +53822,11 @@
if (encrypt) { if (encrypt) {
var ids = trailerDict.get('ID'); var ids = trailerDict.get('ID');
var fileId = ids && ids.length ? ids[0] : ''; var fileId = ids && ids.length ? ids[0] : '';
// The 'Encrypt' dictionary itself should not be encrypted, and by
// setting `suppressEncryption` we can prevent an infinite loop inside
// of `XRef_fetchUncompressed` if the dictionary contains indirect
// objects (fixes issue7665.pdf).
encrypt.suppressEncryption = true;
this.encrypt = new CipherTransformFactory(encrypt, fileId, this.password); this.encrypt = new CipherTransformFactory(encrypt, fileId, this.password);
} }
// get the root dictionary (catalog) object // get the root dictionary (catalog) object
@ -54241,11 +54259,11 @@
} }
return null; return null;
}, },
fetchIfRef: function XRef_fetchIfRef(obj) { fetchIfRef: function XRef_fetchIfRef(obj, suppressEncryption) {
if (!isRef(obj)) { if (!isRef(obj)) {
return obj; return obj;
} }
return this.fetch(obj); return this.fetch(obj, suppressEncryption);
}, },
fetch: function XRef_fetch(ref, suppressEncryption) { fetch: function XRef_fetch(ref, suppressEncryption) {
assert(isRef(ref), 'ref object is not a reference'); assert(isRef(ref), 'ref object is not a reference');
@ -54351,11 +54369,11 @@
} }
return xrefEntry; return xrefEntry;
}, },
fetchIfRefAsync: function XRef_fetchIfRefAsync(obj) { fetchIfRefAsync: function XRef_fetchIfRefAsync(obj, suppressEncryption) {
if (!isRef(obj)) { if (!isRef(obj)) {
return Promise.resolve(obj); return Promise.resolve(obj);
} }
return this.fetchAsync(obj); return this.fetchAsync(obj, suppressEncryption);
}, },
fetchAsync: function XRef_fetchAsync(ref, suppressEncryption) { fetchAsync: function XRef_fetchAsync(ref, suppressEncryption) {
var streamManager = this.stream.manager; var streamManager = this.stream.manager;

4
build/pdf.js

@ -24,8 +24,8 @@
}(this, function (exports) { }(this, function (exports) {
// Use strict in our context only - users might not want it // Use strict in our context only - users might not want it
'use strict'; 'use strict';
var pdfjsVersion = '1.6.239'; var pdfjsVersion = '1.6.242';
var pdfjsBuild = 'f209030'; var pdfjsBuild = 'ea5949f';
var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : null; var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : null;
var pdfjsLibs = {}; var pdfjsLibs = {};
(function pdfjsWrapper() { (function pdfjsWrapper() {

54
build/pdf.worker.js vendored

@ -24,8 +24,8 @@
}(this, function (exports) { }(this, function (exports) {
// Use strict in our context only - users might not want it // Use strict in our context only - users might not want it
'use strict'; 'use strict';
var pdfjsVersion = '1.6.239'; var pdfjsVersion = '1.6.242';
var pdfjsBuild = 'f209030'; var pdfjsBuild = 'ea5949f';
var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : null; var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : null;
var pdfjsLibs = {}; var pdfjsLibs = {};
(function pdfjsWrapper() { (function pdfjsWrapper() {
@ -21098,6 +21098,7 @@
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.__nonSerializable__ = nonSerializable; this.__nonSerializable__ = nonSerializable;
} }
// disable cloning of the Dict // disable cloning of the Dict
@ -21108,42 +21109,42 @@
// automatically dereferences Ref objects // automatically dereferences Ref objects
get: function Dict_get(key1, key2, key3) { get: function Dict_get(key1, key2, key3) {
var value; var value;
var xref = this.xref; var xref = this.xref, 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) : 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) : value; return xref ? xref.fetchIfRef(value, suppressEncryption) : value;
} }
value = this.map[key3] || null; value = this.map[key3] || null;
return xref ? xref.fetchIfRef(value) : value; return xref ? xref.fetchIfRef(value, suppressEncryption) : value;
}, },
// Same as get(), but returns a promise and uses fetchIfRefAsync(). // Same as get(), but returns a promise and uses fetchIfRefAsync().
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;
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); 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); 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); return xref.fetchIfRefAsync(value, suppressEncryption);
} }
return Promise.resolve(value); return Promise.resolve(value);
}, },
// Same as get(), but dereferences all elements if the result is an Array. // Same as get(), but dereferences all elements if the result is an Array.
getArray: function Dict_getArray(key1, key2, key3) { getArray: function Dict_getArray(key1, key2, key3) {
var value = this.get(key1, key2, key3); var value = this.get(key1, key2, key3);
var xref = this.xref; var xref = this.xref, suppressEncryption = this.suppressEncryption;
if (!isArray(value) || !xref) { if (!isArray(value) || !xref) {
return value; return value;
} }
@ -21153,7 +21154,7 @@
if (!isRef(value[i])) { if (!isRef(value[i])) {
continue; continue;
} }
value[i] = xref.fetch(value[i]); value[i] = xref.fetch(value[i], suppressEncryption);
} }
return value; return value;
}, },
@ -30954,11 +30955,12 @@
var PasswordException = sharedUtil.PasswordException; var PasswordException = sharedUtil.PasswordException;
var PasswordResponses = sharedUtil.PasswordResponses; var PasswordResponses = sharedUtil.PasswordResponses;
var bytesToString = sharedUtil.bytesToString; var bytesToString = sharedUtil.bytesToString;
var warn = sharedUtil.warn;
var error = sharedUtil.error; var error = sharedUtil.error;
var assert = sharedUtil.assert;
var isInt = sharedUtil.isInt; var isInt = sharedUtil.isInt;
var stringToBytes = sharedUtil.stringToBytes; var stringToBytes = sharedUtil.stringToBytes;
var utf8StringToString = sharedUtil.utf8StringToString; var utf8StringToString = sharedUtil.utf8StringToString;
var warn = sharedUtil.warn;
var Name = corePrimitives.Name; var Name = corePrimitives.Name;
var isName = corePrimitives.isName; var isName = corePrimitives.isName;
var isDict = corePrimitives.isDict; var isDict = corePrimitives.isDict;
@ -34806,6 +34808,8 @@
var cfDict = dict.get('CF'); var cfDict = dict.get('CF');
var streamCryptoName = dict.get('StmF'); var streamCryptoName = dict.get('StmF');
if (isDict(cfDict) && isName(streamCryptoName)) { if (isDict(cfDict) && isName(streamCryptoName)) {
cfDict.suppressEncryption = true;
// See comment below.
var handlerDict = cfDict.get(streamCryptoName.name); var handlerDict = cfDict.get(streamCryptoName.name);
keyLength = handlerDict && handlerDict.get('Length') || 128; keyLength = handlerDict && handlerDict.get('Length') || 128;
if (keyLength < 40) { if (keyLength < 40) {
@ -34864,7 +34868,15 @@
} }
this.encryptionKey = encryptionKey; this.encryptionKey = encryptionKey;
if (algorithm >= 4) { if (algorithm >= 4) {
this.cf = dict.get('CF'); var cf = dict.get('CF');
if (isDict(cf)) {
// The 'CF' dictionary itself should not be encrypted, and by setting
// `suppressEncryption` we can prevent an infinite loop inside of
// `XRef_fetchUncompressed` if the dictionary contains indirect objects
// (fixes issue7665.pdf).
cf.suppressEncryption = true;
}
this.cf = cf;
this.stmf = dict.get('StmF') || identityName; this.stmf = dict.get('StmF') || identityName;
this.strf = dict.get('StrF') || identityName; this.strf = dict.get('StrF') || identityName;
this.eff = dict.get('EFF') || this.stmf; this.eff = dict.get('EFF') || this.stmf;
@ -34890,6 +34902,7 @@
return hash.subarray(0, Math.min(encryptionKey.length + 5, 16)); return hash.subarray(0, Math.min(encryptionKey.length + 5, 16));
} }
function buildCipherConstructor(cf, name, num, gen, key) { function buildCipherConstructor(cf, name, num, gen, key) {
assert(isName(name), 'Invalid crypt filter name.');
var cryptFilter = cf.get(name.name); var cryptFilter = cf.get(name.name);
var cfm; var cfm;
if (cryptFilter !== null && cryptFilter !== undefined) { if (cryptFilter !== null && cryptFilter !== undefined) {
@ -45870,6 +45883,11 @@
if (encrypt) { if (encrypt) {
var ids = trailerDict.get('ID'); var ids = trailerDict.get('ID');
var fileId = ids && ids.length ? ids[0] : ''; var fileId = ids && ids.length ? ids[0] : '';
// The 'Encrypt' dictionary itself should not be encrypted, and by
// setting `suppressEncryption` we can prevent an infinite loop inside
// of `XRef_fetchUncompressed` if the dictionary contains indirect
// objects (fixes issue7665.pdf).
encrypt.suppressEncryption = true;
this.encrypt = new CipherTransformFactory(encrypt, fileId, this.password); this.encrypt = new CipherTransformFactory(encrypt, fileId, this.password);
} }
// get the root dictionary (catalog) object // get the root dictionary (catalog) object
@ -46302,11 +46320,11 @@
} }
return null; return null;
}, },
fetchIfRef: function XRef_fetchIfRef(obj) { fetchIfRef: function XRef_fetchIfRef(obj, suppressEncryption) {
if (!isRef(obj)) { if (!isRef(obj)) {
return obj; return obj;
} }
return this.fetch(obj); return this.fetch(obj, suppressEncryption);
}, },
fetch: function XRef_fetch(ref, suppressEncryption) { fetch: function XRef_fetch(ref, suppressEncryption) {
assert(isRef(ref), 'ref object is not a reference'); assert(isRef(ref), 'ref object is not a reference');
@ -46412,11 +46430,11 @@
} }
return xrefEntry; return xrefEntry;
}, },
fetchIfRefAsync: function XRef_fetchIfRefAsync(obj) { fetchIfRefAsync: function XRef_fetchIfRefAsync(obj, suppressEncryption) {
if (!isRef(obj)) { if (!isRef(obj)) {
return Promise.resolve(obj); return Promise.resolve(obj);
} }
return this.fetchAsync(obj); return this.fetchAsync(obj, suppressEncryption);
}, },
fetchAsync: function XRef_fetchAsync(ref, suppressEncryption) { fetchAsync: function XRef_fetchAsync(ref, suppressEncryption) {
var streamManager = this.stream.manager; var streamManager = this.stream.manager;

2
package.json

@ -1,6 +1,6 @@
{ {
"name": "pdfjs-dist", "name": "pdfjs-dist",
"version": "1.6.239", "version": "1.6.242",
"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