Browse Source

PDF.js version 1.4.170 - See mozilla/pdf.js@4e2f70440fca20e6c2919a3491346f411fa55129

master v1.4.170
Pdf Bot 9 years ago
parent
commit
fdd51a8301
  1. 2
      bower.json
  2. 93
      build/pdf.combined.js
  3. 13
      build/pdf.js
  4. 84
      build/pdf.worker.js
  5. 2
      package.json

2
bower.json

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

93
build/pdf.combined.js

@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdfCombined = {}));
// 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.4.168'; var pdfjsVersion = '1.4.170';
var pdfjsBuild = 'df0cbcc'; var pdfjsBuild = '4e2f704';
var pdfjsFilePath = var pdfjsFilePath =
typeof document !== 'undefined' && document.currentScript ? typeof document !== 'undefined' && document.currentScript ?
@ -39966,11 +39966,20 @@ var WorkerTransport = (function WorkerTransportClosure() {
var page = this.pageCache[data.pageNum - 1]; var page = this.pageCache[data.pageNum - 1];
var intentState = page.intentStates[data.intent]; var intentState = page.intentStates[data.intent];
if (intentState.displayReadyCapability) { if (intentState.displayReadyCapability) {
intentState.displayReadyCapability.reject(data.error); intentState.displayReadyCapability.reject(data.error);
} else { } else {
error(data.error); error(data.error);
} }
if (intentState.operatorList) {
// Mark operator list as complete.
intentState.operatorList.lastChunk = true;
for (var i = 0; i < intentState.renderTasks.length; i++) {
intentState.renderTasks[i].operatorListChanged();
}
}
}, this); }, this);
messageHandler.on('UnsupportedFeature', messageHandler.on('UnsupportedFeature',
@ -45538,7 +45547,16 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
var preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager); var preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager);
var timeSlotManager = new TimeSlotManager(); var timeSlotManager = new TimeSlotManager();
return new Promise(function next(resolve, reject) { return new Promise(function promiseBody(resolve, reject) {
var next = function (promise) {
promise.then(function () {
try {
promiseBody(resolve, reject);
} catch (ex) {
reject(ex);
}
}, reject);
};
task.ensureNotTerminated(); task.ensureNotTerminated();
timeSlotManager.reset(); timeSlotManager.reset();
var stop, operation = {}, i, ii, cs; var stop, operation = {}, i, ii, cs;
@ -45581,13 +45599,13 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
if (type.name === 'Form') { if (type.name === 'Form') {
stateManager.save(); stateManager.save();
return self.buildFormXObject(resources, xobj, null, next(self.buildFormXObject(resources, xobj, null,
operatorList, task, operatorList, task,
stateManager.state.clone()). stateManager.state.clone()).
then(function () { then(function () {
stateManager.restore(); stateManager.restore();
next(resolve, reject); }));
}, reject); return;
} else if (type.name === 'Image') { } else if (type.name === 'Image') {
self.buildPaintImageXObject(resources, xobj, false, self.buildPaintImageXObject(resources, xobj, false,
operatorList, name, imageCache); operatorList, name, imageCache);
@ -45606,13 +45624,13 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
case OPS.setFont: case OPS.setFont:
var fontSize = args[1]; var fontSize = args[1];
// eagerly collect all fonts // eagerly collect all fonts
return self.handleSetFont(resources, args, null, operatorList, next(self.handleSetFont(resources, args, null, operatorList,
task, stateManager.state). task, stateManager.state).
then(function (loadedName) { then(function (loadedName) {
operatorList.addDependency(loadedName); operatorList.addDependency(loadedName);
operatorList.addOp(OPS.setFont, [loadedName, fontSize]); operatorList.addOp(OPS.setFont, [loadedName, fontSize]);
next(resolve, reject); }));
}, reject); return;
case OPS.endInlineImage: case OPS.endInlineImage:
var cacheKey = args[0].cacheKey; var cacheKey = args[0].cacheKey;
if (cacheKey) { if (cacheKey) {
@ -45712,10 +45730,9 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
case OPS.setFillColorN: case OPS.setFillColorN:
cs = stateManager.state.fillColorSpace; cs = stateManager.state.fillColorSpace;
if (cs.name === 'Pattern') { if (cs.name === 'Pattern') {
return self.handleColorN(operatorList, OPS.setFillColorN, next(self.handleColorN(operatorList, OPS.setFillColorN, args,
args, cs, patterns, resources, task, xref).then(function() { cs, patterns, resources, task, xref));
next(resolve, reject); return;
}, reject);
} }
args = cs.getRgb(args, 0); args = cs.getRgb(args, 0);
fn = OPS.setFillRGBColor; fn = OPS.setFillRGBColor;
@ -45723,10 +45740,9 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
case OPS.setStrokeColorN: case OPS.setStrokeColorN:
cs = stateManager.state.strokeColorSpace; cs = stateManager.state.strokeColorSpace;
if (cs.name === 'Pattern') { if (cs.name === 'Pattern') {
return self.handleColorN(operatorList, OPS.setStrokeColorN, next(self.handleColorN(operatorList, OPS.setStrokeColorN, args,
args, cs, patterns, resources, task, xref).then(function() { cs, patterns, resources, task, xref));
next(resolve, reject); return;
}, reject);
} }
args = cs.getRgb(args, 0); args = cs.getRgb(args, 0);
fn = OPS.setStrokeRGBColor; fn = OPS.setStrokeRGBColor;
@ -45758,10 +45774,9 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
} }
var gState = extGState.get(dictName.name); var gState = extGState.get(dictName.name);
return self.setGState(resources, gState, operatorList, task, next(self.setGState(resources, gState, operatorList, task, xref,
xref, stateManager).then(function() { stateManager));
next(resolve, reject); return;
}, reject);
case OPS.moveTo: case OPS.moveTo:
case OPS.lineTo: case OPS.lineTo:
case OPS.curveTo: case OPS.curveTo:
@ -45806,9 +45821,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
operatorList.addOp(fn, args); operatorList.addOp(fn, args);
} }
if (stop) { if (stop) {
deferred.then(function () { next(deferred);
next(resolve, reject);
}, reject);
return; return;
} }
// Some PDFs don't close all restores inside object/form. // Some PDFs don't close all restores inside object/form.
@ -46084,7 +46097,16 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
var timeSlotManager = new TimeSlotManager(); var timeSlotManager = new TimeSlotManager();
return new Promise(function next(resolve, reject) { return new Promise(function promiseBody(resolve, reject) {
var next = function (promise) {
promise.then(function () {
try {
promiseBody(resolve, reject);
} catch (ex) {
reject(ex);
}
}, reject);
};
task.ensureNotTerminated(); task.ensureNotTerminated();
timeSlotManager.reset(); timeSlotManager.reset();
var stop, operation = {}, args = []; var stop, operation = {}, args = [];
@ -46106,9 +46128,8 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
case OPS.setFont: case OPS.setFont:
flushTextContentItem(); flushTextContentItem();
textState.fontSize = args[1]; textState.fontSize = args[1];
return handleSetFont(args[0].name).then(function() { next(handleSetFont(args[0].name));
next(resolve, reject); return;
}, reject);
case OPS.setTextRise: case OPS.setTextRise:
flushTextContentItem(); flushTextContentItem();
textState.textRise = args[0]; textState.textRise = args[0];
@ -46279,7 +46300,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
stateManager.transform(matrix); stateManager.transform(matrix);
} }
return self.getTextContent(xobj, task, next(self.getTextContent(xobj, task,
xobj.dict.get('Resources') || resources, stateManager, xobj.dict.get('Resources') || resources, stateManager,
normalizeWhitespace).then(function (formTextContent) { normalizeWhitespace).then(function (formTextContent) {
Util.appendToArray(textContent.items, formTextContent.items); Util.appendToArray(textContent.items, formTextContent.items);
@ -46288,9 +46309,8 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
xobjsCache.key = name; xobjsCache.key = name;
xobjsCache.texts = formTextContent; xobjsCache.texts = formTextContent;
}));
next(resolve, reject); return;
}, reject);
case OPS.setGState: case OPS.setGState:
flushTextContentItem(); flushTextContentItem();
var dictName = args[0]; var dictName = args[0];
@ -46310,17 +46330,14 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
} }
if (gsStateFont) { if (gsStateFont) {
textState.fontSize = gsStateFont[1]; textState.fontSize = gsStateFont[1];
return handleSetFont(gsStateFont[0]).then(function() { next(handleSetFont(gsStateFont[0]));
next(resolve, reject); return;
}, reject);
} }
break; break;
} // switch } // switch
} // while } // while
if (stop) { if (stop) {
deferred.then(function () { next(deferred);
next(resolve, reject);
}, reject);
return; return;
} }
flushTextContentItem(); flushTextContentItem();

13
build/pdf.js

@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdf = {}));
// 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.4.168'; var pdfjsVersion = '1.4.170';
var pdfjsBuild = 'df0cbcc'; var pdfjsBuild = '4e2f704';
var pdfjsFilePath = var pdfjsFilePath =
typeof document !== 'undefined' && document.currentScript ? typeof document !== 'undefined' && document.currentScript ?
@ -10188,11 +10188,20 @@ var WorkerTransport = (function WorkerTransportClosure() {
var page = this.pageCache[data.pageNum - 1]; var page = this.pageCache[data.pageNum - 1];
var intentState = page.intentStates[data.intent]; var intentState = page.intentStates[data.intent];
if (intentState.displayReadyCapability) { if (intentState.displayReadyCapability) {
intentState.displayReadyCapability.reject(data.error); intentState.displayReadyCapability.reject(data.error);
} else { } else {
error(data.error); error(data.error);
} }
if (intentState.operatorList) {
// Mark operator list as complete.
intentState.operatorList.lastChunk = true;
for (var i = 0; i < intentState.renderTasks.length; i++) {
intentState.renderTasks[i].operatorListChanged();
}
}
}, this); }, this);
messageHandler.on('UnsupportedFeature', messageHandler.on('UnsupportedFeature',

84
build/pdf.worker.js vendored

@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdfWorker = {}));
// 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.4.168'; var pdfjsVersion = '1.4.170';
var pdfjsBuild = 'df0cbcc'; var pdfjsBuild = '4e2f704';
var pdfjsFilePath = var pdfjsFilePath =
typeof document !== 'undefined' && document.currentScript ? typeof document !== 'undefined' && document.currentScript ?
@ -37380,7 +37380,16 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
var preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager); var preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager);
var timeSlotManager = new TimeSlotManager(); var timeSlotManager = new TimeSlotManager();
return new Promise(function next(resolve, reject) { return new Promise(function promiseBody(resolve, reject) {
var next = function (promise) {
promise.then(function () {
try {
promiseBody(resolve, reject);
} catch (ex) {
reject(ex);
}
}, reject);
};
task.ensureNotTerminated(); task.ensureNotTerminated();
timeSlotManager.reset(); timeSlotManager.reset();
var stop, operation = {}, i, ii, cs; var stop, operation = {}, i, ii, cs;
@ -37423,13 +37432,13 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
if (type.name === 'Form') { if (type.name === 'Form') {
stateManager.save(); stateManager.save();
return self.buildFormXObject(resources, xobj, null, next(self.buildFormXObject(resources, xobj, null,
operatorList, task, operatorList, task,
stateManager.state.clone()). stateManager.state.clone()).
then(function () { then(function () {
stateManager.restore(); stateManager.restore();
next(resolve, reject); }));
}, reject); return;
} else if (type.name === 'Image') { } else if (type.name === 'Image') {
self.buildPaintImageXObject(resources, xobj, false, self.buildPaintImageXObject(resources, xobj, false,
operatorList, name, imageCache); operatorList, name, imageCache);
@ -37448,13 +37457,13 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
case OPS.setFont: case OPS.setFont:
var fontSize = args[1]; var fontSize = args[1];
// eagerly collect all fonts // eagerly collect all fonts
return self.handleSetFont(resources, args, null, operatorList, next(self.handleSetFont(resources, args, null, operatorList,
task, stateManager.state). task, stateManager.state).
then(function (loadedName) { then(function (loadedName) {
operatorList.addDependency(loadedName); operatorList.addDependency(loadedName);
operatorList.addOp(OPS.setFont, [loadedName, fontSize]); operatorList.addOp(OPS.setFont, [loadedName, fontSize]);
next(resolve, reject); }));
}, reject); return;
case OPS.endInlineImage: case OPS.endInlineImage:
var cacheKey = args[0].cacheKey; var cacheKey = args[0].cacheKey;
if (cacheKey) { if (cacheKey) {
@ -37554,10 +37563,9 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
case OPS.setFillColorN: case OPS.setFillColorN:
cs = stateManager.state.fillColorSpace; cs = stateManager.state.fillColorSpace;
if (cs.name === 'Pattern') { if (cs.name === 'Pattern') {
return self.handleColorN(operatorList, OPS.setFillColorN, next(self.handleColorN(operatorList, OPS.setFillColorN, args,
args, cs, patterns, resources, task, xref).then(function() { cs, patterns, resources, task, xref));
next(resolve, reject); return;
}, reject);
} }
args = cs.getRgb(args, 0); args = cs.getRgb(args, 0);
fn = OPS.setFillRGBColor; fn = OPS.setFillRGBColor;
@ -37565,10 +37573,9 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
case OPS.setStrokeColorN: case OPS.setStrokeColorN:
cs = stateManager.state.strokeColorSpace; cs = stateManager.state.strokeColorSpace;
if (cs.name === 'Pattern') { if (cs.name === 'Pattern') {
return self.handleColorN(operatorList, OPS.setStrokeColorN, next(self.handleColorN(operatorList, OPS.setStrokeColorN, args,
args, cs, patterns, resources, task, xref).then(function() { cs, patterns, resources, task, xref));
next(resolve, reject); return;
}, reject);
} }
args = cs.getRgb(args, 0); args = cs.getRgb(args, 0);
fn = OPS.setStrokeRGBColor; fn = OPS.setStrokeRGBColor;
@ -37600,10 +37607,9 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
} }
var gState = extGState.get(dictName.name); var gState = extGState.get(dictName.name);
return self.setGState(resources, gState, operatorList, task, next(self.setGState(resources, gState, operatorList, task, xref,
xref, stateManager).then(function() { stateManager));
next(resolve, reject); return;
}, reject);
case OPS.moveTo: case OPS.moveTo:
case OPS.lineTo: case OPS.lineTo:
case OPS.curveTo: case OPS.curveTo:
@ -37648,9 +37654,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
operatorList.addOp(fn, args); operatorList.addOp(fn, args);
} }
if (stop) { if (stop) {
deferred.then(function () { next(deferred);
next(resolve, reject);
}, reject);
return; return;
} }
// Some PDFs don't close all restores inside object/form. // Some PDFs don't close all restores inside object/form.
@ -37926,7 +37930,16 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
var timeSlotManager = new TimeSlotManager(); var timeSlotManager = new TimeSlotManager();
return new Promise(function next(resolve, reject) { return new Promise(function promiseBody(resolve, reject) {
var next = function (promise) {
promise.then(function () {
try {
promiseBody(resolve, reject);
} catch (ex) {
reject(ex);
}
}, reject);
};
task.ensureNotTerminated(); task.ensureNotTerminated();
timeSlotManager.reset(); timeSlotManager.reset();
var stop, operation = {}, args = []; var stop, operation = {}, args = [];
@ -37948,9 +37961,8 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
case OPS.setFont: case OPS.setFont:
flushTextContentItem(); flushTextContentItem();
textState.fontSize = args[1]; textState.fontSize = args[1];
return handleSetFont(args[0].name).then(function() { next(handleSetFont(args[0].name));
next(resolve, reject); return;
}, reject);
case OPS.setTextRise: case OPS.setTextRise:
flushTextContentItem(); flushTextContentItem();
textState.textRise = args[0]; textState.textRise = args[0];
@ -38121,7 +38133,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
stateManager.transform(matrix); stateManager.transform(matrix);
} }
return self.getTextContent(xobj, task, next(self.getTextContent(xobj, task,
xobj.dict.get('Resources') || resources, stateManager, xobj.dict.get('Resources') || resources, stateManager,
normalizeWhitespace).then(function (formTextContent) { normalizeWhitespace).then(function (formTextContent) {
Util.appendToArray(textContent.items, formTextContent.items); Util.appendToArray(textContent.items, formTextContent.items);
@ -38130,9 +38142,8 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
xobjsCache.key = name; xobjsCache.key = name;
xobjsCache.texts = formTextContent; xobjsCache.texts = formTextContent;
}));
next(resolve, reject); return;
}, reject);
case OPS.setGState: case OPS.setGState:
flushTextContentItem(); flushTextContentItem();
var dictName = args[0]; var dictName = args[0];
@ -38152,17 +38163,14 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
} }
if (gsStateFont) { if (gsStateFont) {
textState.fontSize = gsStateFont[1]; textState.fontSize = gsStateFont[1];
return handleSetFont(gsStateFont[0]).then(function() { next(handleSetFont(gsStateFont[0]));
next(resolve, reject); return;
}, reject);
} }
break; break;
} // switch } // switch
} // while } // while
if (stop) { if (stop) {
deferred.then(function () { next(deferred);
next(resolve, reject);
}, reject);
return; return;
} }
flushTextContentItem(); flushTextContentItem();

2
package.json

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