Browse Source

PDF.js version 1.7.397 - See mozilla/pdf.js@72eeb1ccb3afaab25d3c581456f9080fae75c0ff

master v1.7.397
pdfjsbot 8 years ago
parent
commit
248af8e31b
  1. 2
      bower.json
  2. 39
      build/pdf.combined.js
  3. 12
      build/pdf.js
  4. 6
      build/pdf.min.js
  5. 31
      build/pdf.worker.js
  6. 34
      build/pdf.worker.min.js
  7. 27
      lib/core/obj.js
  8. 4
      lib/display/api.js
  9. 4
      lib/display/global.js
  10. 4
      lib/pdf.js
  11. 4
      lib/pdf.worker.js
  12. 2
      package.json

2
bower.json

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

39
build/pdf.combined.js

@ -12716,8 +12716,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
} }
}; };
}(); }();
exports.version = '1.7.395'; exports.version = '1.7.397';
exports.build = '07f7c97b'; exports.build = '72eeb1cc';
exports.getDocument = getDocument; exports.getDocument = getDocument;
exports.PDFDataRangeTransport = PDFDataRangeTransport; exports.PDFDataRangeTransport = PDFDataRangeTransport;
exports.PDFWorker = PDFWorker; exports.PDFWorker = PDFWorker;
@ -22837,6 +22837,7 @@ var stringToUTF8String = sharedUtil.stringToUTF8String;
var warn = sharedUtil.warn; var warn = sharedUtil.warn;
var createValidAbsoluteUrl = sharedUtil.createValidAbsoluteUrl; var createValidAbsoluteUrl = sharedUtil.createValidAbsoluteUrl;
var Util = sharedUtil.Util; var Util = sharedUtil.Util;
var Dict = corePrimitives.Dict;
var Ref = corePrimitives.Ref; var Ref = corePrimitives.Ref;
var RefSet = corePrimitives.RefSet; var RefSet = corePrimitives.RefSet;
var RefSetCache = corePrimitives.RefSetCache; var RefSetCache = corePrimitives.RefSetCache;
@ -22856,9 +22857,10 @@ var Catalog = function CatalogClosure() {
this.pdfManager = pdfManager; this.pdfManager = pdfManager;
this.xref = xref; this.xref = xref;
this.catDict = xref.getCatalogObj(); this.catDict = xref.getCatalogObj();
assert(isDict(this.catDict), 'catalog object is not a dictionary');
this.fontCache = new RefSetCache(); this.fontCache = new RefSetCache();
this.builtInCMapCache = Object.create(null); this.builtInCMapCache = Object.create(null);
assert(isDict(this.catDict), 'catalog object is not a dictionary'); this.pageKidsCountCache = new RefSetCache();
this.pageFactory = pageFactory; this.pageFactory = pageFactory;
this.pagePromises = []; this.pagePromises = [];
} }
@ -23174,6 +23176,7 @@ var Catalog = function CatalogClosure() {
return shadow(this, 'javaScript', javaScript); return shadow(this, 'javaScript', javaScript);
}, },
cleanup: function Catalog_cleanup() { cleanup: function Catalog_cleanup() {
this.pageKidsCountCache.clear();
var promises = []; var promises = [];
this.fontCache.forEach(function (promise) { this.fontCache.forEach(function (promise) {
promises.push(promise); promises.push(promise);
@ -23200,15 +23203,25 @@ var Catalog = function CatalogClosure() {
getPageDict: function Catalog_getPageDict(pageIndex) { getPageDict: function Catalog_getPageDict(pageIndex) {
var capability = createPromiseCapability(); var capability = createPromiseCapability();
var nodesToVisit = [this.catDict.getRaw('Pages')]; var nodesToVisit = [this.catDict.getRaw('Pages')];
var currentPageIndex = 0; var count,
var xref = this.xref; currentPageIndex = 0;
var xref = this.xref,
pageKidsCountCache = this.pageKidsCountCache;
function next() { function next() {
while (nodesToVisit.length) { while (nodesToVisit.length) {
var currentNode = nodesToVisit.pop(); var currentNode = nodesToVisit.pop();
if (isRef(currentNode)) { if (isRef(currentNode)) {
count = pageKidsCountCache.get(currentNode);
if (count > 0 && currentPageIndex + count < pageIndex) {
currentPageIndex += count;
continue;
}
xref.fetchAsync(currentNode).then(function (obj) { xref.fetchAsync(currentNode).then(function (obj) {
if (isDict(obj, 'Page') || isDict(obj) && !obj.has('Kids')) { if (isDict(obj, 'Page') || isDict(obj) && !obj.has('Kids')) {
if (pageIndex === currentPageIndex) { if (pageIndex === currentPageIndex) {
if (currentNode && !pageKidsCountCache.has(currentNode)) {
pageKidsCountCache.put(currentNode, 1);
}
capability.resolve([obj, currentNode]); capability.resolve([obj, currentNode]);
} else { } else {
currentPageIndex++; currentPageIndex++;
@ -23222,7 +23235,11 @@ var Catalog = function CatalogClosure() {
return; return;
} }
assert(isDict(currentNode), 'page dictionary kid reference points to wrong type of object'); assert(isDict(currentNode), 'page dictionary kid reference points to wrong type of object');
var count = currentNode.get('Count'); count = currentNode.get('Count');
var objId = currentNode.objId;
if (objId && !pageKidsCountCache.has(objId)) {
pageKidsCountCache.put(objId, count);
}
if (currentPageIndex + count <= pageIndex) { if (currentPageIndex + count <= pageIndex) {
currentPageIndex += count; currentPageIndex += count;
continue; continue;
@ -23814,7 +23831,7 @@ var XRef = function XRefClosure() {
var num = ref.num; var num = ref.num;
if (num in this.cache) { if (num in this.cache) {
var cacheEntry = this.cache[num]; var cacheEntry = this.cache[num];
if (isDict(cacheEntry) && !cacheEntry.objId) { if (cacheEntry instanceof Dict && !cacheEntry.objId) {
cacheEntry.objId = ref.toString(); cacheEntry.objId = ref.toString();
} }
return cacheEntry; return cacheEntry;
@ -27891,8 +27908,8 @@ if (!globalScope.PDFJS) {
globalScope.PDFJS = {}; globalScope.PDFJS = {};
} }
var PDFJS = globalScope.PDFJS; var PDFJS = globalScope.PDFJS;
PDFJS.version = '1.7.395'; PDFJS.version = '1.7.397';
PDFJS.build = '07f7c97b'; PDFJS.build = '72eeb1cc';
PDFJS.pdfBug = false; PDFJS.pdfBug = false;
if (PDFJS.verbosity !== undefined) { if (PDFJS.verbosity !== undefined) {
sharedUtil.setVerbosityLevel(PDFJS.verbosity); sharedUtil.setVerbosityLevel(PDFJS.verbosity);
@ -43430,8 +43447,8 @@ exports.TilingPattern = TilingPattern;
"use strict"; "use strict";
var pdfjsVersion = '1.7.395'; var pdfjsVersion = '1.7.397';
var pdfjsBuild = '07f7c97b'; var pdfjsBuild = '72eeb1cc';
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);

12
build/pdf.js

@ -3430,8 +3430,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
} }
}; };
}(); }();
exports.version = '1.7.395'; exports.version = '1.7.397';
exports.build = '07f7c97b'; exports.build = '72eeb1cc';
exports.getDocument = getDocument; exports.getDocument = getDocument;
exports.PDFDataRangeTransport = PDFDataRangeTransport; exports.PDFDataRangeTransport = PDFDataRangeTransport;
exports.PDFWorker = PDFWorker; exports.PDFWorker = PDFWorker;
@ -5370,8 +5370,8 @@ if (!globalScope.PDFJS) {
globalScope.PDFJS = {}; globalScope.PDFJS = {};
} }
var PDFJS = globalScope.PDFJS; var PDFJS = globalScope.PDFJS;
PDFJS.version = '1.7.395'; PDFJS.version = '1.7.397';
PDFJS.build = '07f7c97b'; PDFJS.build = '72eeb1cc';
PDFJS.pdfBug = false; PDFJS.pdfBug = false;
if (PDFJS.verbosity !== undefined) { if (PDFJS.verbosity !== undefined) {
sharedUtil.setVerbosityLevel(PDFJS.verbosity); sharedUtil.setVerbosityLevel(PDFJS.verbosity);
@ -7881,8 +7881,8 @@ exports.TilingPattern = TilingPattern;
"use strict"; "use strict";
var pdfjsVersion = '1.7.395'; var pdfjsVersion = '1.7.397';
var pdfjsBuild = '07f7c97b'; var pdfjsBuild = '72eeb1cc';
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);

6
build/pdf.min.js vendored

File diff suppressed because one or more lines are too long

31
build/pdf.worker.js vendored

@ -19944,6 +19944,7 @@ var stringToUTF8String = sharedUtil.stringToUTF8String;
var warn = sharedUtil.warn; var warn = sharedUtil.warn;
var createValidAbsoluteUrl = sharedUtil.createValidAbsoluteUrl; var createValidAbsoluteUrl = sharedUtil.createValidAbsoluteUrl;
var Util = sharedUtil.Util; var Util = sharedUtil.Util;
var Dict = corePrimitives.Dict;
var Ref = corePrimitives.Ref; var Ref = corePrimitives.Ref;
var RefSet = corePrimitives.RefSet; var RefSet = corePrimitives.RefSet;
var RefSetCache = corePrimitives.RefSetCache; var RefSetCache = corePrimitives.RefSetCache;
@ -19963,9 +19964,10 @@ var Catalog = function CatalogClosure() {
this.pdfManager = pdfManager; this.pdfManager = pdfManager;
this.xref = xref; this.xref = xref;
this.catDict = xref.getCatalogObj(); this.catDict = xref.getCatalogObj();
assert(isDict(this.catDict), 'catalog object is not a dictionary');
this.fontCache = new RefSetCache(); this.fontCache = new RefSetCache();
this.builtInCMapCache = Object.create(null); this.builtInCMapCache = Object.create(null);
assert(isDict(this.catDict), 'catalog object is not a dictionary'); this.pageKidsCountCache = new RefSetCache();
this.pageFactory = pageFactory; this.pageFactory = pageFactory;
this.pagePromises = []; this.pagePromises = [];
} }
@ -20281,6 +20283,7 @@ var Catalog = function CatalogClosure() {
return shadow(this, 'javaScript', javaScript); return shadow(this, 'javaScript', javaScript);
}, },
cleanup: function Catalog_cleanup() { cleanup: function Catalog_cleanup() {
this.pageKidsCountCache.clear();
var promises = []; var promises = [];
this.fontCache.forEach(function (promise) { this.fontCache.forEach(function (promise) {
promises.push(promise); promises.push(promise);
@ -20307,15 +20310,25 @@ var Catalog = function CatalogClosure() {
getPageDict: function Catalog_getPageDict(pageIndex) { getPageDict: function Catalog_getPageDict(pageIndex) {
var capability = createPromiseCapability(); var capability = createPromiseCapability();
var nodesToVisit = [this.catDict.getRaw('Pages')]; var nodesToVisit = [this.catDict.getRaw('Pages')];
var currentPageIndex = 0; var count,
var xref = this.xref; currentPageIndex = 0;
var xref = this.xref,
pageKidsCountCache = this.pageKidsCountCache;
function next() { function next() {
while (nodesToVisit.length) { while (nodesToVisit.length) {
var currentNode = nodesToVisit.pop(); var currentNode = nodesToVisit.pop();
if (isRef(currentNode)) { if (isRef(currentNode)) {
count = pageKidsCountCache.get(currentNode);
if (count > 0 && currentPageIndex + count < pageIndex) {
currentPageIndex += count;
continue;
}
xref.fetchAsync(currentNode).then(function (obj) { xref.fetchAsync(currentNode).then(function (obj) {
if (isDict(obj, 'Page') || isDict(obj) && !obj.has('Kids')) { if (isDict(obj, 'Page') || isDict(obj) && !obj.has('Kids')) {
if (pageIndex === currentPageIndex) { if (pageIndex === currentPageIndex) {
if (currentNode && !pageKidsCountCache.has(currentNode)) {
pageKidsCountCache.put(currentNode, 1);
}
capability.resolve([obj, currentNode]); capability.resolve([obj, currentNode]);
} else { } else {
currentPageIndex++; currentPageIndex++;
@ -20329,7 +20342,11 @@ var Catalog = function CatalogClosure() {
return; return;
} }
assert(isDict(currentNode), 'page dictionary kid reference points to wrong type of object'); assert(isDict(currentNode), 'page dictionary kid reference points to wrong type of object');
var count = currentNode.get('Count'); count = currentNode.get('Count');
var objId = currentNode.objId;
if (objId && !pageKidsCountCache.has(objId)) {
pageKidsCountCache.put(objId, count);
}
if (currentPageIndex + count <= pageIndex) { if (currentPageIndex + count <= pageIndex) {
currentPageIndex += count; currentPageIndex += count;
continue; continue;
@ -20921,7 +20938,7 @@ var XRef = function XRefClosure() {
var num = ref.num; var num = ref.num;
if (num in this.cache) { if (num in this.cache) {
var cacheEntry = this.cache[num]; var cacheEntry = this.cache[num];
if (isDict(cacheEntry) && !cacheEntry.objId) { if (cacheEntry instanceof Dict && !cacheEntry.objId) {
cacheEntry.objId = ref.toString(); cacheEntry.objId = ref.toString();
} }
return cacheEntry; return cacheEntry;
@ -36890,8 +36907,8 @@ exports.Type1Parser = Type1Parser;
"use strict"; "use strict";
var pdfjsVersion = '1.7.395'; var pdfjsVersion = '1.7.397';
var pdfjsBuild = '07f7c97b'; var pdfjsBuild = '72eeb1cc';
var pdfjsCoreWorker = __w_pdfjs_require__(8); var pdfjsCoreWorker = __w_pdfjs_require__(8);
{ {
__w_pdfjs_require__(19); __w_pdfjs_require__(19);

34
build/pdf.worker.min.js vendored

File diff suppressed because one or more lines are too long

27
lib/core/obj.js

@ -38,6 +38,7 @@ var stringToUTF8String = sharedUtil.stringToUTF8String;
var warn = sharedUtil.warn; var warn = sharedUtil.warn;
var createValidAbsoluteUrl = sharedUtil.createValidAbsoluteUrl; var createValidAbsoluteUrl = sharedUtil.createValidAbsoluteUrl;
var Util = sharedUtil.Util; var Util = sharedUtil.Util;
var Dict = corePrimitives.Dict;
var Ref = corePrimitives.Ref; var Ref = corePrimitives.Ref;
var RefSet = corePrimitives.RefSet; var RefSet = corePrimitives.RefSet;
var RefSetCache = corePrimitives.RefSetCache; var RefSetCache = corePrimitives.RefSetCache;
@ -57,9 +58,10 @@ var Catalog = function CatalogClosure() {
this.pdfManager = pdfManager; this.pdfManager = pdfManager;
this.xref = xref; this.xref = xref;
this.catDict = xref.getCatalogObj(); this.catDict = xref.getCatalogObj();
assert(isDict(this.catDict), 'catalog object is not a dictionary');
this.fontCache = new RefSetCache(); this.fontCache = new RefSetCache();
this.builtInCMapCache = Object.create(null); this.builtInCMapCache = Object.create(null);
assert(isDict(this.catDict), 'catalog object is not a dictionary'); this.pageKidsCountCache = new RefSetCache();
this.pageFactory = pageFactory; this.pageFactory = pageFactory;
this.pagePromises = []; this.pagePromises = [];
} }
@ -375,6 +377,7 @@ var Catalog = function CatalogClosure() {
return shadow(this, 'javaScript', javaScript); return shadow(this, 'javaScript', javaScript);
}, },
cleanup: function Catalog_cleanup() { cleanup: function Catalog_cleanup() {
this.pageKidsCountCache.clear();
var promises = []; var promises = [];
this.fontCache.forEach(function (promise) { this.fontCache.forEach(function (promise) {
promises.push(promise); promises.push(promise);
@ -401,15 +404,25 @@ var Catalog = function CatalogClosure() {
getPageDict: function Catalog_getPageDict(pageIndex) { getPageDict: function Catalog_getPageDict(pageIndex) {
var capability = createPromiseCapability(); var capability = createPromiseCapability();
var nodesToVisit = [this.catDict.getRaw('Pages')]; var nodesToVisit = [this.catDict.getRaw('Pages')];
var currentPageIndex = 0; var count,
var xref = this.xref; currentPageIndex = 0;
var xref = this.xref,
pageKidsCountCache = this.pageKidsCountCache;
function next() { function next() {
while (nodesToVisit.length) { while (nodesToVisit.length) {
var currentNode = nodesToVisit.pop(); var currentNode = nodesToVisit.pop();
if (isRef(currentNode)) { if (isRef(currentNode)) {
count = pageKidsCountCache.get(currentNode);
if (count > 0 && currentPageIndex + count < pageIndex) {
currentPageIndex += count;
continue;
}
xref.fetchAsync(currentNode).then(function (obj) { xref.fetchAsync(currentNode).then(function (obj) {
if (isDict(obj, 'Page') || isDict(obj) && !obj.has('Kids')) { if (isDict(obj, 'Page') || isDict(obj) && !obj.has('Kids')) {
if (pageIndex === currentPageIndex) { if (pageIndex === currentPageIndex) {
if (currentNode && !pageKidsCountCache.has(currentNode)) {
pageKidsCountCache.put(currentNode, 1);
}
capability.resolve([obj, currentNode]); capability.resolve([obj, currentNode]);
} else { } else {
currentPageIndex++; currentPageIndex++;
@ -423,7 +436,11 @@ var Catalog = function CatalogClosure() {
return; return;
} }
assert(isDict(currentNode), 'page dictionary kid reference points to wrong type of object'); assert(isDict(currentNode), 'page dictionary kid reference points to wrong type of object');
var count = currentNode.get('Count'); count = currentNode.get('Count');
var objId = currentNode.objId;
if (objId && !pageKidsCountCache.has(objId)) {
pageKidsCountCache.put(objId, count);
}
if (currentPageIndex + count <= pageIndex) { if (currentPageIndex + count <= pageIndex) {
currentPageIndex += count; currentPageIndex += count;
continue; continue;
@ -1015,7 +1032,7 @@ var XRef = function XRefClosure() {
var num = ref.num; var num = ref.num;
if (num in this.cache) { if (num in this.cache) {
var cacheEntry = this.cache[num]; var cacheEntry = this.cache[num];
if (isDict(cacheEntry) && !cacheEntry.objId) { if (cacheEntry instanceof Dict && !cacheEntry.objId) {
cacheEntry.objId = ref.toString(); cacheEntry.objId = ref.toString();
} }
return cacheEntry; return cacheEntry;

4
lib/display/api.js

@ -1372,8 +1372,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
} }
}; };
}(); }();
exports.version = '1.7.395'; exports.version = '1.7.397';
exports.build = '07f7c97b'; exports.build = '72eeb1cc';
exports.getDocument = getDocument; exports.getDocument = getDocument;
exports.PDFDataRangeTransport = PDFDataRangeTransport; exports.PDFDataRangeTransport = PDFDataRangeTransport;
exports.PDFWorker = PDFWorker; exports.PDFWorker = PDFWorker;

4
lib/display/global.js

@ -31,8 +31,8 @@ if (!globalScope.PDFJS) {
globalScope.PDFJS = {}; globalScope.PDFJS = {};
} }
var PDFJS = globalScope.PDFJS; var PDFJS = globalScope.PDFJS;
PDFJS.version = '1.7.395'; PDFJS.version = '1.7.397';
PDFJS.build = '07f7c97b'; PDFJS.build = '72eeb1cc';
PDFJS.pdfBug = false; PDFJS.pdfBug = false;
if (PDFJS.verbosity !== undefined) { if (PDFJS.verbosity !== undefined) {
sharedUtil.setVerbosityLevel(PDFJS.verbosity); sharedUtil.setVerbosityLevel(PDFJS.verbosity);

4
lib/pdf.js

@ -14,8 +14,8 @@
*/ */
'use strict'; 'use strict';
var pdfjsVersion = '1.7.395'; var pdfjsVersion = '1.7.397';
var pdfjsBuild = '07f7c97b'; var pdfjsBuild = '72eeb1cc';
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.7.395'; var pdfjsVersion = '1.7.397';
var pdfjsBuild = '07f7c97b'; var pdfjsBuild = '72eeb1cc';
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.7.395", "version": "1.7.397",
"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