Browse Source

PDF.js version 1.7.387 - See mozilla/pdf.js@b6bf1a3eb86be38dbd200555a8963acc2873f8a2

master v1.7.387
pdfjsbot 8 years ago
parent
commit
d719632116
  1. 2
      bower.json
  2. 70
      build/pdf.combined.js
  3. 12
      build/pdf.js
  4. 4
      build/pdf.min.js
  5. 62
      build/pdf.worker.js
  6. 10
      build/pdf.worker.min.js
  7. 58
      lib/core/evaluator.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 @@ @@ -1,6 +1,6 @@
{
"name": "pdfjs-dist",
"version": "1.7.384",
"version": "1.7.387",
"main": [
"build/pdf.js",
"build/pdf.worker.js"

70
build/pdf.combined.js

@ -20022,8 +20022,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() { @@ -20022,8 +20022,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
}
};
}();
exports.version = '1.7.384';
exports.build = 'b7ba44b5';
exports.version = '1.7.387';
exports.build = 'b6bf1a3e';
exports.getDocument = getDocument;
exports.PDFDataRangeTransport = PDFDataRangeTransport;
exports.PDFWorker = PDFWorker;
@ -28845,7 +28845,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -28845,7 +28845,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
fontName = fontArgs[0].name;
}
var self = this;
return this.loadFont(fontName, fontRef, this.xref, resources).then(function (translated) {
return this.loadFont(fontName, fontRef, resources).then(function (translated) {
if (!translated.font.isType3Font) {
return translated;
}
@ -28887,7 +28887,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -28887,7 +28887,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
}
return glyphs;
},
setGState: function PartialEvaluator_setGState(resources, gState, operatorList, task, xref, stateManager) {
setGState: function PartialEvaluator_setGState(resources, gState, operatorList, task, stateManager) {
var gStateObj = [];
var gStateKeys = gState.getKeys();
var self = this;
@ -28979,11 +28979,11 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -28979,11 +28979,11 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
}
});
},
loadFont: function PartialEvaluator_loadFont(fontName, font, xref, resources) {
loadFont: function PartialEvaluator_loadFont(fontName, font, resources) {
function errorFont() {
return Promise.resolve(new TranslatedFont('g_font_error', new ErrorFont('Font ' + fontName + ' is not available'), font));
}
var fontRef;
var fontRef, xref = this.xref;
if (font) {
assert(isRef(font));
fontRef = font;
@ -29011,7 +29011,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -29011,7 +29011,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
return font.translated;
}
var fontCapability = createPromiseCapability();
var preEvaluatedFont = this.preEvaluateFont(font, xref);
var preEvaluatedFont = this.preEvaluateFont(font);
var descriptor = preEvaluatedFont.descriptor;
var fontRefIsRef = isRef(fontRef), fontID;
if (fontRefIsRef) {
@ -29050,7 +29050,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -29050,7 +29050,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
font.translated = fontCapability.promise;
var translatedPromise;
try {
translatedPromise = this.translateFont(preEvaluatedFont, xref);
translatedPromise = this.translateFont(preEvaluatedFont);
} catch (e) {
translatedPromise = Promise.reject(e);
}
@ -29092,7 +29092,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -29092,7 +29092,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
Array.prototype.push.apply(opArgs[1], args);
}
},
handleColorN: function PartialEvaluator_handleColorN(operatorList, fn, args, cs, patterns, resources, task, xref) {
handleColorN: function PartialEvaluator_handleColorN(operatorList, fn, args, cs, patterns, resources, task) {
var patternName = args[args.length - 1];
var pattern;
if (isName(patternName) && (pattern = patterns.get(patternName.name))) {
@ -29104,7 +29104,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -29104,7 +29104,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
} else if (typeNum === SHADING_PATTERN) {
var shading = dict.get('Shading');
var matrix = dict.getArray('Matrix');
pattern = Pattern.parseShading(shading, matrix, xref, resources, this.handler);
pattern = Pattern.parseShading(shading, matrix, this.xref, resources, this.handler);
operatorList.addOp(fn, pattern.getIR());
return Promise.resolve();
}
@ -29286,7 +29286,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -29286,7 +29286,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
case OPS.setFillColorN:
cs = stateManager.state.fillColorSpace;
if (cs.name === 'Pattern') {
next(self.handleColorN(operatorList, OPS.setFillColorN, args, cs, patterns, resources, task, xref));
next(self.handleColorN(operatorList, OPS.setFillColorN, args, cs, patterns, resources, task));
return;
}
args = cs.getRgb(args, 0);
@ -29295,7 +29295,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -29295,7 +29295,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
case OPS.setStrokeColorN:
cs = stateManager.state.strokeColorSpace;
if (cs.name === 'Pattern') {
next(self.handleColorN(operatorList, OPS.setStrokeColorN, args, cs, patterns, resources, task, xref));
next(self.handleColorN(operatorList, OPS.setStrokeColorN, args, cs, patterns, resources, task));
return;
}
args = cs.getRgb(args, 0);
@ -29303,13 +29303,9 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -29303,13 +29303,9 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
break;
case OPS.shadingFill:
var shadingRes = resources.get('Shading');
if (!shadingRes) {
error('No shading resource found');
}
assert(shadingRes, 'No shading resource found');
var shading = shadingRes.get(args[0].name);
if (!shading) {
error('No shading object found');
}
assert(shading, 'No shading object found');
var shadingFill = Pattern.parseShading(shading, null, xref, resources, self.handler);
var patternIR = shadingFill.getIR();
args = [patternIR];
@ -29322,7 +29318,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -29322,7 +29318,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
break;
}
var gState = extGState.get(dictName.name);
next(self.setGState(resources, gState, operatorList, task, xref, stateManager));
next(self.setGState(resources, gState, operatorList, task, stateManager));
return;
case OPS.moveTo:
case OPS.lineTo:
@ -29488,7 +29484,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -29488,7 +29484,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
};
}
function handleSetFont(fontName, fontRef) {
return self.loadFont(fontName, fontRef, xref, resources).then(function (translated) {
return self.loadFont(fontName, fontRef, resources).then(function (translated) {
textState.font = translated.font;
textState.fontMatrix = translated.font.fontMatrix || FONT_IDENTITY_MATRIX;
});
@ -29783,7 +29779,8 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -29783,7 +29779,8 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
resolve(textContent);
});
},
extractDataStructures: function PartialEvaluator_extractDataStructures(dict, baseDict, xref, properties) {
extractDataStructures: function PartialEvaluator_extractDataStructures(dict, baseDict, properties) {
var xref = this.xref;
var toUnicode = dict.get('ToUnicode') || baseDict.get('ToUnicode');
var toUnicodePromise = toUnicode ? this.readToUnicode(toUnicode) : Promise.resolve(undefined);
if (properties.composite) {
@ -30006,7 +30003,8 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -30006,7 +30003,8 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
}
return result;
},
extractWidths: function PartialEvaluator_extractWidths(dict, xref, descriptor, properties) {
extractWidths: function PartialEvaluator_extractWidths(dict, descriptor, properties) {
var xref = this.xref;
var glyphsWidths = [];
var defaultWidth = 0;
var glyphsVMetrics = [];
@ -30156,7 +30154,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -30156,7 +30154,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
}
return widths;
},
preEvaluateFont: function PartialEvaluator_preEvaluateFont(dict, xref) {
preEvaluateFont: function PartialEvaluator_preEvaluateFont(dict) {
var baseDict = dict;
var type = dict.get('Subtype');
assert(isName(type), 'invalid font Subtype');
@ -30164,10 +30162,8 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -30164,10 +30162,8 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
var uint8array;
if (type.name === 'Type0') {
var df = dict.get('DescendantFonts');
if (!df) {
error('Descendant fonts are not specified');
}
dict = isArray(df) ? xref.fetchIfRef(df[0]) : df;
assert(df, 'Descendant fonts are not specified');
dict = isArray(df) ? this.xref.fetchIfRef(df[0]) : df;
type = dict.get('Subtype');
assert(isName(type), 'invalid font Subtype');
composite = true;
@ -30225,7 +30221,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -30225,7 +30221,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
hash: hash ? hash.hexdigest() : ''
};
},
translateFont: function PartialEvaluator_translateFont(preEvaluatedFont, xref) {
translateFont: function PartialEvaluator_translateFont(preEvaluatedFont) {
var baseDict = preEvaluatedFont.baseDict;
var dict = preEvaluatedFont.dict;
var composite = preEvaluatedFont.composite;
@ -30240,9 +30236,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -30240,9 +30236,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
descriptor.set('FontBBox', dict.getArray('FontBBox'));
} else {
var baseFontName = dict.get('BaseFont');
if (!isName(baseFontName)) {
error('Base font is not specified');
}
assert(isName(baseFontName), 'Base font is not specified');
baseFontName = baseFontName.name.replace(/[,_]/g, '-');
var metrics = this.getBaseFontMetrics(baseFontName);
var fontNameWoStyle = baseFontName.split('-')[0];
@ -30256,7 +30250,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -30256,7 +30250,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
firstChar: 0,
lastChar: maxCharIndex
};
return this.extractDataStructures(dict, dict, xref, properties).then(function (properties) {
return this.extractDataStructures(dict, dict, properties).then(function (properties) {
properties.widths = this.buildCharCodeToWidth(metrics.widths, properties);
return new Font(baseFontName, null, properties);
}.bind(this));
@ -30338,9 +30332,9 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -30338,9 +30332,9 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
cMapPromise = Promise.resolve(undefined);
}
return cMapPromise.then(function () {
return this.extractDataStructures(dict, baseDict, xref, properties);
return this.extractDataStructures(dict, baseDict, properties);
}.bind(this)).then(function (properties) {
this.extractWidths(dict, xref, descriptor, properties);
this.extractWidths(dict, descriptor, properties);
if (type === 'Type3') {
properties.isType3Font = true;
}
@ -38780,8 +38774,8 @@ if (!globalScope.PDFJS) { @@ -38780,8 +38774,8 @@ if (!globalScope.PDFJS) {
globalScope.PDFJS = {};
}
var PDFJS = globalScope.PDFJS;
PDFJS.version = '1.7.384';
PDFJS.build = 'b7ba44b5';
PDFJS.version = '1.7.387';
PDFJS.build = 'b6bf1a3e';
PDFJS.pdfBug = false;
if (PDFJS.verbosity !== undefined) {
sharedUtil.setVerbosityLevel(PDFJS.verbosity);
@ -56485,8 +56479,8 @@ exports.TilingPattern = TilingPattern; @@ -56485,8 +56479,8 @@ exports.TilingPattern = TilingPattern;
"use strict";
var pdfjsVersion = '1.7.384';
var pdfjsBuild = 'b7ba44b5';
var pdfjsVersion = '1.7.387';
var pdfjsBuild = 'b6bf1a3e';
var pdfjsSharedUtil = __w_pdfjs_require__(0);
var pdfjsDisplayGlobal = __w_pdfjs_require__(26);
var pdfjsDisplayAPI = __w_pdfjs_require__(10);

12
build/pdf.js

@ -3735,8 +3735,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() { @@ -3735,8 +3735,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
}
};
}();
exports.version = '1.7.384';
exports.build = 'b7ba44b5';
exports.version = '1.7.387';
exports.build = 'b6bf1a3e';
exports.getDocument = getDocument;
exports.PDFDataRangeTransport = PDFDataRangeTransport;
exports.PDFWorker = PDFWorker;
@ -5768,8 +5768,8 @@ if (!globalScope.PDFJS) { @@ -5768,8 +5768,8 @@ if (!globalScope.PDFJS) {
globalScope.PDFJS = {};
}
var PDFJS = globalScope.PDFJS;
PDFJS.version = '1.7.384';
PDFJS.build = 'b7ba44b5';
PDFJS.version = '1.7.387';
PDFJS.build = 'b6bf1a3e';
PDFJS.pdfBug = false;
if (PDFJS.verbosity !== undefined) {
sharedUtil.setVerbosityLevel(PDFJS.verbosity);
@ -8436,8 +8436,8 @@ exports.TilingPattern = TilingPattern; @@ -8436,8 +8436,8 @@ exports.TilingPattern = TilingPattern;
"use strict";
var pdfjsVersion = '1.7.384';
var pdfjsBuild = 'b7ba44b5';
var pdfjsVersion = '1.7.387';
var pdfjsBuild = 'b6bf1a3e';
var pdfjsSharedUtil = __w_pdfjs_require__(0);
var pdfjsDisplayGlobal = __w_pdfjs_require__(9);
var pdfjsDisplayAPI = __w_pdfjs_require__(3);

4
build/pdf.min.js vendored

File diff suppressed because one or more lines are too long

62
build/pdf.worker.js vendored

@ -25862,7 +25862,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -25862,7 +25862,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
fontName = fontArgs[0].name;
}
var self = this;
return this.loadFont(fontName, fontRef, this.xref, resources).then(function (translated) {
return this.loadFont(fontName, fontRef, resources).then(function (translated) {
if (!translated.font.isType3Font) {
return translated;
}
@ -25904,7 +25904,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -25904,7 +25904,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
}
return glyphs;
},
setGState: function PartialEvaluator_setGState(resources, gState, operatorList, task, xref, stateManager) {
setGState: function PartialEvaluator_setGState(resources, gState, operatorList, task, stateManager) {
var gStateObj = [];
var gStateKeys = gState.getKeys();
var self = this;
@ -25996,11 +25996,11 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -25996,11 +25996,11 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
}
});
},
loadFont: function PartialEvaluator_loadFont(fontName, font, xref, resources) {
loadFont: function PartialEvaluator_loadFont(fontName, font, resources) {
function errorFont() {
return Promise.resolve(new TranslatedFont('g_font_error', new ErrorFont('Font ' + fontName + ' is not available'), font));
}
var fontRef;
var fontRef, xref = this.xref;
if (font) {
assert(isRef(font));
fontRef = font;
@ -26028,7 +26028,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -26028,7 +26028,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
return font.translated;
}
var fontCapability = createPromiseCapability();
var preEvaluatedFont = this.preEvaluateFont(font, xref);
var preEvaluatedFont = this.preEvaluateFont(font);
var descriptor = preEvaluatedFont.descriptor;
var fontRefIsRef = isRef(fontRef), fontID;
if (fontRefIsRef) {
@ -26067,7 +26067,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -26067,7 +26067,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
font.translated = fontCapability.promise;
var translatedPromise;
try {
translatedPromise = this.translateFont(preEvaluatedFont, xref);
translatedPromise = this.translateFont(preEvaluatedFont);
} catch (e) {
translatedPromise = Promise.reject(e);
}
@ -26109,7 +26109,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -26109,7 +26109,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
Array.prototype.push.apply(opArgs[1], args);
}
},
handleColorN: function PartialEvaluator_handleColorN(operatorList, fn, args, cs, patterns, resources, task, xref) {
handleColorN: function PartialEvaluator_handleColorN(operatorList, fn, args, cs, patterns, resources, task) {
var patternName = args[args.length - 1];
var pattern;
if (isName(patternName) && (pattern = patterns.get(patternName.name))) {
@ -26121,7 +26121,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -26121,7 +26121,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
} else if (typeNum === SHADING_PATTERN) {
var shading = dict.get('Shading');
var matrix = dict.getArray('Matrix');
pattern = Pattern.parseShading(shading, matrix, xref, resources, this.handler);
pattern = Pattern.parseShading(shading, matrix, this.xref, resources, this.handler);
operatorList.addOp(fn, pattern.getIR());
return Promise.resolve();
}
@ -26303,7 +26303,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -26303,7 +26303,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
case OPS.setFillColorN:
cs = stateManager.state.fillColorSpace;
if (cs.name === 'Pattern') {
next(self.handleColorN(operatorList, OPS.setFillColorN, args, cs, patterns, resources, task, xref));
next(self.handleColorN(operatorList, OPS.setFillColorN, args, cs, patterns, resources, task));
return;
}
args = cs.getRgb(args, 0);
@ -26312,7 +26312,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -26312,7 +26312,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
case OPS.setStrokeColorN:
cs = stateManager.state.strokeColorSpace;
if (cs.name === 'Pattern') {
next(self.handleColorN(operatorList, OPS.setStrokeColorN, args, cs, patterns, resources, task, xref));
next(self.handleColorN(operatorList, OPS.setStrokeColorN, args, cs, patterns, resources, task));
return;
}
args = cs.getRgb(args, 0);
@ -26320,13 +26320,9 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -26320,13 +26320,9 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
break;
case OPS.shadingFill:
var shadingRes = resources.get('Shading');
if (!shadingRes) {
error('No shading resource found');
}
assert(shadingRes, 'No shading resource found');
var shading = shadingRes.get(args[0].name);
if (!shading) {
error('No shading object found');
}
assert(shading, 'No shading object found');
var shadingFill = Pattern.parseShading(shading, null, xref, resources, self.handler);
var patternIR = shadingFill.getIR();
args = [patternIR];
@ -26339,7 +26335,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -26339,7 +26335,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
break;
}
var gState = extGState.get(dictName.name);
next(self.setGState(resources, gState, operatorList, task, xref, stateManager));
next(self.setGState(resources, gState, operatorList, task, stateManager));
return;
case OPS.moveTo:
case OPS.lineTo:
@ -26505,7 +26501,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -26505,7 +26501,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
};
}
function handleSetFont(fontName, fontRef) {
return self.loadFont(fontName, fontRef, xref, resources).then(function (translated) {
return self.loadFont(fontName, fontRef, resources).then(function (translated) {
textState.font = translated.font;
textState.fontMatrix = translated.font.fontMatrix || FONT_IDENTITY_MATRIX;
});
@ -26800,7 +26796,8 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -26800,7 +26796,8 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
resolve(textContent);
});
},
extractDataStructures: function PartialEvaluator_extractDataStructures(dict, baseDict, xref, properties) {
extractDataStructures: function PartialEvaluator_extractDataStructures(dict, baseDict, properties) {
var xref = this.xref;
var toUnicode = dict.get('ToUnicode') || baseDict.get('ToUnicode');
var toUnicodePromise = toUnicode ? this.readToUnicode(toUnicode) : Promise.resolve(undefined);
if (properties.composite) {
@ -27023,7 +27020,8 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -27023,7 +27020,8 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
}
return result;
},
extractWidths: function PartialEvaluator_extractWidths(dict, xref, descriptor, properties) {
extractWidths: function PartialEvaluator_extractWidths(dict, descriptor, properties) {
var xref = this.xref;
var glyphsWidths = [];
var defaultWidth = 0;
var glyphsVMetrics = [];
@ -27173,7 +27171,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -27173,7 +27171,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
}
return widths;
},
preEvaluateFont: function PartialEvaluator_preEvaluateFont(dict, xref) {
preEvaluateFont: function PartialEvaluator_preEvaluateFont(dict) {
var baseDict = dict;
var type = dict.get('Subtype');
assert(isName(type), 'invalid font Subtype');
@ -27181,10 +27179,8 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -27181,10 +27179,8 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
var uint8array;
if (type.name === 'Type0') {
var df = dict.get('DescendantFonts');
if (!df) {
error('Descendant fonts are not specified');
}
dict = isArray(df) ? xref.fetchIfRef(df[0]) : df;
assert(df, 'Descendant fonts are not specified');
dict = isArray(df) ? this.xref.fetchIfRef(df[0]) : df;
type = dict.get('Subtype');
assert(isName(type), 'invalid font Subtype');
composite = true;
@ -27242,7 +27238,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -27242,7 +27238,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
hash: hash ? hash.hexdigest() : ''
};
},
translateFont: function PartialEvaluator_translateFont(preEvaluatedFont, xref) {
translateFont: function PartialEvaluator_translateFont(preEvaluatedFont) {
var baseDict = preEvaluatedFont.baseDict;
var dict = preEvaluatedFont.dict;
var composite = preEvaluatedFont.composite;
@ -27257,9 +27253,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -27257,9 +27253,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
descriptor.set('FontBBox', dict.getArray('FontBBox'));
} else {
var baseFontName = dict.get('BaseFont');
if (!isName(baseFontName)) {
error('Base font is not specified');
}
assert(isName(baseFontName), 'Base font is not specified');
baseFontName = baseFontName.name.replace(/[,_]/g, '-');
var metrics = this.getBaseFontMetrics(baseFontName);
var fontNameWoStyle = baseFontName.split('-')[0];
@ -27273,7 +27267,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -27273,7 +27267,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
firstChar: 0,
lastChar: maxCharIndex
};
return this.extractDataStructures(dict, dict, xref, properties).then(function (properties) {
return this.extractDataStructures(dict, dict, properties).then(function (properties) {
properties.widths = this.buildCharCodeToWidth(metrics.widths, properties);
return new Font(baseFontName, null, properties);
}.bind(this));
@ -27355,9 +27349,9 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -27355,9 +27349,9 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
cMapPromise = Promise.resolve(undefined);
}
return cMapPromise.then(function () {
return this.extractDataStructures(dict, baseDict, xref, properties);
return this.extractDataStructures(dict, baseDict, properties);
}.bind(this)).then(function (properties) {
this.extractWidths(dict, xref, descriptor, properties);
this.extractWidths(dict, descriptor, properties);
if (type === 'Type3') {
properties.isType3Font = true;
}
@ -49673,8 +49667,8 @@ exports.Type1Parser = Type1Parser; @@ -49673,8 +49667,8 @@ exports.Type1Parser = Type1Parser;
"use strict";
var pdfjsVersion = '1.7.384';
var pdfjsBuild = 'b7ba44b5';
var pdfjsVersion = '1.7.387';
var pdfjsBuild = 'b6bf1a3e';
var pdfjsCoreWorker = __w_pdfjs_require__(8);
{
__w_pdfjs_require__(19);

10
build/pdf.worker.min.js vendored

File diff suppressed because one or more lines are too long

58
lib/core/evaluator.js

@ -408,7 +408,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -408,7 +408,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
fontName = fontArgs[0].name;
}
var self = this;
return this.loadFont(fontName, fontRef, this.xref, resources).then(function (translated) {
return this.loadFont(fontName, fontRef, resources).then(function (translated) {
if (!translated.font.isType3Font) {
return translated;
}
@ -450,7 +450,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -450,7 +450,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
}
return glyphs;
},
setGState: function PartialEvaluator_setGState(resources, gState, operatorList, task, xref, stateManager) {
setGState: function PartialEvaluator_setGState(resources, gState, operatorList, task, stateManager) {
var gStateObj = [];
var gStateKeys = gState.getKeys();
var self = this;
@ -542,11 +542,11 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -542,11 +542,11 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
}
});
},
loadFont: function PartialEvaluator_loadFont(fontName, font, xref, resources) {
loadFont: function PartialEvaluator_loadFont(fontName, font, resources) {
function errorFont() {
return Promise.resolve(new TranslatedFont('g_font_error', new ErrorFont('Font ' + fontName + ' is not available'), font));
}
var fontRef;
var fontRef, xref = this.xref;
if (font) {
assert(isRef(font));
fontRef = font;
@ -574,7 +574,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -574,7 +574,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
return font.translated;
}
var fontCapability = createPromiseCapability();
var preEvaluatedFont = this.preEvaluateFont(font, xref);
var preEvaluatedFont = this.preEvaluateFont(font);
var descriptor = preEvaluatedFont.descriptor;
var fontRefIsRef = isRef(fontRef), fontID;
if (fontRefIsRef) {
@ -613,7 +613,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -613,7 +613,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
font.translated = fontCapability.promise;
var translatedPromise;
try {
translatedPromise = this.translateFont(preEvaluatedFont, xref);
translatedPromise = this.translateFont(preEvaluatedFont);
} catch (e) {
translatedPromise = Promise.reject(e);
}
@ -655,7 +655,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -655,7 +655,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
Array.prototype.push.apply(opArgs[1], args);
}
},
handleColorN: function PartialEvaluator_handleColorN(operatorList, fn, args, cs, patterns, resources, task, xref) {
handleColorN: function PartialEvaluator_handleColorN(operatorList, fn, args, cs, patterns, resources, task) {
var patternName = args[args.length - 1];
var pattern;
if (isName(patternName) && (pattern = patterns.get(patternName.name))) {
@ -667,7 +667,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -667,7 +667,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
} else if (typeNum === SHADING_PATTERN) {
var shading = dict.get('Shading');
var matrix = dict.getArray('Matrix');
pattern = Pattern.parseShading(shading, matrix, xref, resources, this.handler);
pattern = Pattern.parseShading(shading, matrix, this.xref, resources, this.handler);
operatorList.addOp(fn, pattern.getIR());
return Promise.resolve();
}
@ -849,7 +849,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -849,7 +849,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
case OPS.setFillColorN:
cs = stateManager.state.fillColorSpace;
if (cs.name === 'Pattern') {
next(self.handleColorN(operatorList, OPS.setFillColorN, args, cs, patterns, resources, task, xref));
next(self.handleColorN(operatorList, OPS.setFillColorN, args, cs, patterns, resources, task));
return;
}
args = cs.getRgb(args, 0);
@ -858,7 +858,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -858,7 +858,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
case OPS.setStrokeColorN:
cs = stateManager.state.strokeColorSpace;
if (cs.name === 'Pattern') {
next(self.handleColorN(operatorList, OPS.setStrokeColorN, args, cs, patterns, resources, task, xref));
next(self.handleColorN(operatorList, OPS.setStrokeColorN, args, cs, patterns, resources, task));
return;
}
args = cs.getRgb(args, 0);
@ -866,13 +866,9 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -866,13 +866,9 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
break;
case OPS.shadingFill:
var shadingRes = resources.get('Shading');
if (!shadingRes) {
error('No shading resource found');
}
assert(shadingRes, 'No shading resource found');
var shading = shadingRes.get(args[0].name);
if (!shading) {
error('No shading object found');
}
assert(shading, 'No shading object found');
var shadingFill = Pattern.parseShading(shading, null, xref, resources, self.handler);
var patternIR = shadingFill.getIR();
args = [patternIR];
@ -885,7 +881,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -885,7 +881,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
break;
}
var gState = extGState.get(dictName.name);
next(self.setGState(resources, gState, operatorList, task, xref, stateManager));
next(self.setGState(resources, gState, operatorList, task, stateManager));
return;
case OPS.moveTo:
case OPS.lineTo:
@ -1051,7 +1047,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -1051,7 +1047,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
};
}
function handleSetFont(fontName, fontRef) {
return self.loadFont(fontName, fontRef, xref, resources).then(function (translated) {
return self.loadFont(fontName, fontRef, resources).then(function (translated) {
textState.font = translated.font;
textState.fontMatrix = translated.font.fontMatrix || FONT_IDENTITY_MATRIX;
});
@ -1346,7 +1342,8 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -1346,7 +1342,8 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
resolve(textContent);
});
},
extractDataStructures: function PartialEvaluator_extractDataStructures(dict, baseDict, xref, properties) {
extractDataStructures: function PartialEvaluator_extractDataStructures(dict, baseDict, properties) {
var xref = this.xref;
var toUnicode = dict.get('ToUnicode') || baseDict.get('ToUnicode');
var toUnicodePromise = toUnicode ? this.readToUnicode(toUnicode) : Promise.resolve(undefined);
if (properties.composite) {
@ -1569,7 +1566,8 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -1569,7 +1566,8 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
}
return result;
},
extractWidths: function PartialEvaluator_extractWidths(dict, xref, descriptor, properties) {
extractWidths: function PartialEvaluator_extractWidths(dict, descriptor, properties) {
var xref = this.xref;
var glyphsWidths = [];
var defaultWidth = 0;
var glyphsVMetrics = [];
@ -1719,7 +1717,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -1719,7 +1717,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
}
return widths;
},
preEvaluateFont: function PartialEvaluator_preEvaluateFont(dict, xref) {
preEvaluateFont: function PartialEvaluator_preEvaluateFont(dict) {
var baseDict = dict;
var type = dict.get('Subtype');
assert(isName(type), 'invalid font Subtype');
@ -1727,10 +1725,8 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -1727,10 +1725,8 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
var uint8array;
if (type.name === 'Type0') {
var df = dict.get('DescendantFonts');
if (!df) {
error('Descendant fonts are not specified');
}
dict = isArray(df) ? xref.fetchIfRef(df[0]) : df;
assert(df, 'Descendant fonts are not specified');
dict = isArray(df) ? this.xref.fetchIfRef(df[0]) : df;
type = dict.get('Subtype');
assert(isName(type), 'invalid font Subtype');
composite = true;
@ -1788,7 +1784,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -1788,7 +1784,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
hash: hash ? hash.hexdigest() : ''
};
},
translateFont: function PartialEvaluator_translateFont(preEvaluatedFont, xref) {
translateFont: function PartialEvaluator_translateFont(preEvaluatedFont) {
var baseDict = preEvaluatedFont.baseDict;
var dict = preEvaluatedFont.dict;
var composite = preEvaluatedFont.composite;
@ -1803,9 +1799,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -1803,9 +1799,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
descriptor.set('FontBBox', dict.getArray('FontBBox'));
} else {
var baseFontName = dict.get('BaseFont');
if (!isName(baseFontName)) {
error('Base font is not specified');
}
assert(isName(baseFontName), 'Base font is not specified');
baseFontName = baseFontName.name.replace(/[,_]/g, '-');
var metrics = this.getBaseFontMetrics(baseFontName);
var fontNameWoStyle = baseFontName.split('-')[0];
@ -1819,7 +1813,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -1819,7 +1813,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
firstChar: 0,
lastChar: maxCharIndex
};
return this.extractDataStructures(dict, dict, xref, properties).then(function (properties) {
return this.extractDataStructures(dict, dict, properties).then(function (properties) {
properties.widths = this.buildCharCodeToWidth(metrics.widths, properties);
return new Font(baseFontName, null, properties);
}.bind(this));
@ -1901,9 +1895,9 @@ var PartialEvaluator = function PartialEvaluatorClosure() { @@ -1901,9 +1895,9 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
cMapPromise = Promise.resolve(undefined);
}
return cMapPromise.then(function () {
return this.extractDataStructures(dict, baseDict, xref, properties);
return this.extractDataStructures(dict, baseDict, properties);
}.bind(this)).then(function (properties) {
this.extractWidths(dict, xref, descriptor, properties);
this.extractWidths(dict, descriptor, properties);
if (type === 'Type3') {
properties.isType3Font = true;
}

4
lib/display/api.js

@ -1374,8 +1374,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() { @@ -1374,8 +1374,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
}
};
}();
exports.version = '1.7.384';
exports.build = 'b7ba44b5';
exports.version = '1.7.387';
exports.build = 'b6bf1a3e';
exports.getDocument = getDocument;
exports.PDFDataRangeTransport = PDFDataRangeTransport;
exports.PDFWorker = PDFWorker;

4
lib/display/global.js

@ -30,8 +30,8 @@ if (!globalScope.PDFJS) { @@ -30,8 +30,8 @@ if (!globalScope.PDFJS) {
globalScope.PDFJS = {};
}
var PDFJS = globalScope.PDFJS;
PDFJS.version = '1.7.384';
PDFJS.build = 'b7ba44b5';
PDFJS.version = '1.7.387';
PDFJS.build = 'b6bf1a3e';
PDFJS.pdfBug = false;
if (PDFJS.verbosity !== undefined) {
sharedUtil.setVerbosityLevel(PDFJS.verbosity);

4
lib/pdf.js

@ -13,8 +13,8 @@ @@ -13,8 +13,8 @@
* limitations under the License.
*/
'use strict';
var pdfjsVersion = '1.7.384';
var pdfjsBuild = 'b7ba44b5';
var pdfjsVersion = '1.7.387';
var pdfjsBuild = 'b6bf1a3e';
var pdfjsSharedUtil = require('./shared/util.js');
var pdfjsDisplayGlobal = require('./display/global.js');
var pdfjsDisplayAPI = require('./display/api.js');

4
lib/pdf.worker.js vendored

@ -13,8 +13,8 @@ @@ -13,8 +13,8 @@
* limitations under the License.
*/
'use strict';
var pdfjsVersion = '1.7.384';
var pdfjsBuild = 'b7ba44b5';
var pdfjsVersion = '1.7.387';
var pdfjsBuild = 'b6bf1a3e';
var pdfjsCoreWorker = require('./core/worker.js');
{
require('./core/network.js');

2
package.json

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

Loading…
Cancel
Save