Browse Source

PDF.js version 1.5.250 - See mozilla/pdf.js@c1c199d70277a2a42fe1ac12ef598248076ac829

master v1.5.250
Pdf Bot 9 years ago
parent
commit
67de9ce7ee
  1. 2
      bower.json
  2. 98
      build/pdf.combined.js
  3. 4
      build/pdf.js
  4. 98
      build/pdf.worker.js
  5. 2
      package.json

2
bower.json

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

98
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.5.248'; var pdfjsVersion = '1.5.250';
var pdfjsBuild = '69cf8c5'; var pdfjsBuild = 'c1c199d';
var pdfjsFilePath = var pdfjsFilePath =
typeof document !== 'undefined' && document.currentScript ? typeof document !== 'undefined' && document.currentScript ?
@ -22466,7 +22466,7 @@ var JpegStream = (function JpegStreamClosure() {
// checking if values needs to be transformed before conversion // checking if values needs to be transformed before conversion
if (this.forceRGB && this.dict && isArray(this.dict.get('Decode'))) { if (this.forceRGB && this.dict && isArray(this.dict.get('Decode'))) {
var decodeArr = this.dict.get('Decode'); var decodeArr = this.dict.getArray('Decode');
var bitsPerComponent = this.dict.get('BitsPerComponent') || 8; var bitsPerComponent = this.dict.get('BitsPerComponent') || 8;
var decodeArrLength = decodeArr.length; var decodeArrLength = decodeArr.length;
var transform = new Int32Array(decodeArrLength); var transform = new Int32Array(decodeArrLength);
@ -22606,8 +22606,8 @@ var Jbig2Stream = (function Jbig2StreamClosure() {
var jbig2Image = new Jbig2Image(); var jbig2Image = new Jbig2Image();
var chunks = [], xref = this.dict.xref; var chunks = [];
var decodeParams = xref.fetchIfRef(this.dict.get('DecodeParms')); var decodeParams = this.dict.getArray('DecodeParms');
// According to the PDF specification, DecodeParms can be either // According to the PDF specification, DecodeParms can be either
// a dictionary, or an array whose elements are dictionaries. // a dictionary, or an array whose elements are dictionaries.
@ -22616,7 +22616,7 @@ var Jbig2Stream = (function Jbig2StreamClosure() {
warn('JBIG2 - \'DecodeParms\' array with multiple elements ' + warn('JBIG2 - \'DecodeParms\' array with multiple elements ' +
'not supported.'); 'not supported.');
} }
decodeParams = xref.fetchIfRef(decodeParams[0]); decodeParams = decodeParams[0];
} }
if (decodeParams && decodeParams.has('JBIG2Globals')) { if (decodeParams && decodeParams.has('JBIG2Globals')) {
var globalsStream = decodeParams.get('JBIG2Globals'); var globalsStream = decodeParams.get('JBIG2Globals');
@ -37562,8 +37562,8 @@ var PDFFunction = (function PDFFunctionClosure() {
} }
return out; return out;
} }
var domain = dict.get('Domain'); var domain = dict.getArray('Domain');
var range = dict.get('Range'); var range = dict.getArray('Range');
if (!domain || !range) { if (!domain || !range) {
error('No domain or range'); error('No domain or range');
@ -37584,7 +37584,7 @@ var PDFFunction = (function PDFFunctionClosure() {
info('No support for cubic spline interpolation: ' + order); info('No support for cubic spline interpolation: ' + order);
} }
var encode = dict.get('Encode'); var encode = dict.getArray('Encode');
if (!encode) { if (!encode) {
encode = []; encode = [];
for (var i = 0; i < inputSize; ++i) { for (var i = 0; i < inputSize; ++i) {
@ -37594,7 +37594,7 @@ var PDFFunction = (function PDFFunctionClosure() {
} }
encode = toMultiArray(encode); encode = toMultiArray(encode);
var decode = dict.get('Decode'); var decode = dict.getArray('Decode');
if (!decode) { if (!decode) {
decode = range; decode = range;
} else { } else {
@ -37696,8 +37696,8 @@ var PDFFunction = (function PDFFunctionClosure() {
constructInterpolated: function PDFFunction_constructInterpolated(str, constructInterpolated: function PDFFunction_constructInterpolated(str,
dict) { dict) {
var c0 = dict.get('C0') || [0]; var c0 = dict.getArray('C0') || [0];
var c1 = dict.get('C1') || [1]; var c1 = dict.getArray('C1') || [1];
var n = dict.get('N'); var n = dict.get('N');
if (!isArray(c0) || !isArray(c1)) { if (!isArray(c0) || !isArray(c1)) {
@ -37732,7 +37732,7 @@ var PDFFunction = (function PDFFunctionClosure() {
}, },
constructStiched: function PDFFunction_constructStiched(fn, dict, xref) { constructStiched: function PDFFunction_constructStiched(fn, dict, xref) {
var domain = dict.get('Domain'); var domain = dict.getArray('Domain');
if (!domain) { if (!domain) {
error('No domain'); error('No domain');
@ -37749,8 +37749,8 @@ var PDFFunction = (function PDFFunctionClosure() {
fns.push(PDFFunction.getIR(xref, xref.fetchIfRef(fnRefs[i]))); fns.push(PDFFunction.getIR(xref, xref.fetchIfRef(fnRefs[i])));
} }
var bounds = dict.get('Bounds'); var bounds = dict.getArray('Bounds');
var encode = dict.get('Encode'); var encode = dict.getArray('Encode');
return [CONSTRUCT_STICHED, domain, bounds, encode, fns]; return [CONSTRUCT_STICHED, domain, bounds, encode, fns];
}, },
@ -37812,8 +37812,8 @@ var PDFFunction = (function PDFFunctionClosure() {
constructPostScript: function PDFFunction_constructPostScript(fn, dict, constructPostScript: function PDFFunction_constructPostScript(fn, dict,
xref) { xref) {
var domain = dict.get('Domain'); var domain = dict.getArray('Domain');
var range = dict.get('Range'); var range = dict.getArray('Range');
if (!domain) { if (!domain) {
error('No domain.'); error('No domain.');
@ -40778,16 +40778,16 @@ var ColorSpace = (function ColorSpaceClosure() {
return 'DeviceCmykCS'; return 'DeviceCmykCS';
case 'CalGray': case 'CalGray':
params = xref.fetchIfRef(cs[1]); params = xref.fetchIfRef(cs[1]);
whitePoint = params.get('WhitePoint'); whitePoint = params.getArray('WhitePoint');
blackPoint = params.get('BlackPoint'); blackPoint = params.getArray('BlackPoint');
gamma = params.get('Gamma'); gamma = params.get('Gamma');
return ['CalGrayCS', whitePoint, blackPoint, gamma]; return ['CalGrayCS', whitePoint, blackPoint, gamma];
case 'CalRGB': case 'CalRGB':
params = xref.fetchIfRef(cs[1]); params = xref.fetchIfRef(cs[1]);
whitePoint = params.get('WhitePoint'); whitePoint = params.getArray('WhitePoint');
blackPoint = params.get('BlackPoint'); blackPoint = params.getArray('BlackPoint');
gamma = params.get('Gamma'); gamma = params.getArray('Gamma');
var matrix = params.get('Matrix'); var matrix = params.getArray('Matrix');
return ['CalRGBCS', whitePoint, blackPoint, gamma, matrix]; return ['CalRGBCS', whitePoint, blackPoint, gamma, matrix];
case 'ICCBased': case 'ICCBased':
var stream = xref.fetchIfRef(cs[1]); var stream = xref.fetchIfRef(cs[1]);
@ -40841,9 +40841,9 @@ var ColorSpace = (function ColorSpaceClosure() {
return ['AlternateCS', numComps, alt, tintFnIR]; return ['AlternateCS', numComps, alt, tintFnIR];
case 'Lab': case 'Lab':
params = xref.fetchIfRef(cs[1]); params = xref.fetchIfRef(cs[1]);
whitePoint = params.get('WhitePoint'); whitePoint = params.getArray('WhitePoint');
blackPoint = params.get('BlackPoint'); blackPoint = params.getArray('BlackPoint');
var range = params.get('Range'); var range = params.getArray('Range');
return ['LabCS', whitePoint, blackPoint, range]; return ['LabCS', whitePoint, blackPoint, range];
default: default:
error('unimplemented color space object "' + mode + '"'); error('unimplemented color space object "' + mode + '"');
@ -42198,7 +42198,7 @@ var PDFImage = (function PDFImageClosure() {
this.numComps = this.colorSpace.numComps; this.numComps = this.colorSpace.numComps;
} }
this.decode = dict.get('Decode', 'D'); this.decode = dict.getArray('Decode', 'D');
this.needsDecode = false; this.needsDecode = false;
if (this.decode && if (this.decode &&
((this.colorSpace && !this.colorSpace.isDefaultDecode(this.decode)) || ((this.colorSpace && !this.colorSpace.isDefaultDecode(this.decode)) ||
@ -42849,7 +42849,7 @@ var Catalog = (function CatalogClosure() {
var title = outlineDict.get('Title'); var title = outlineDict.get('Title');
var flags = outlineDict.get('F') || 0; var flags = outlineDict.get('F') || 0;
var color = outlineDict.get('C'), rgbColor = blackColor; var color = outlineDict.getArray('C'), rgbColor = blackColor;
// We only need to parse the color when it's valid, and non-default. // We only need to parse the color when it's valid, and non-default.
if (isArray(color) && color.length === 3 && if (isArray(color) && color.length === 3 &&
(color[0] !== 0 || color[1] !== 0 || color[2] !== 0)) { (color[0] !== 0 || color[1] !== 0 || color[2] !== 0)) {
@ -44375,7 +44375,7 @@ Shadings.SMALL_NUMBER = 1e-6;
Shadings.RadialAxial = (function RadialAxialClosure() { Shadings.RadialAxial = (function RadialAxialClosure() {
function RadialAxial(dict, matrix, xref, res) { function RadialAxial(dict, matrix, xref, res) {
this.matrix = matrix; this.matrix = matrix;
this.coordsArr = dict.get('Coords'); this.coordsArr = dict.getArray('Coords');
this.shadingType = dict.get('ShadingType'); this.shadingType = dict.get('ShadingType');
this.type = 'Pattern'; this.type = 'Pattern';
var cs = dict.get('ColorSpace', 'CS'); var cs = dict.get('ColorSpace', 'CS');
@ -44384,14 +44384,14 @@ Shadings.RadialAxial = (function RadialAxialClosure() {
var t0 = 0.0, t1 = 1.0; var t0 = 0.0, t1 = 1.0;
if (dict.has('Domain')) { if (dict.has('Domain')) {
var domainArr = dict.get('Domain'); var domainArr = dict.getArray('Domain');
t0 = domainArr[0]; t0 = domainArr[0];
t1 = domainArr[1]; t1 = domainArr[1];
} }
var extendStart = false, extendEnd = false; var extendStart = false, extendEnd = false;
if (dict.has('Extend')) { if (dict.has('Extend')) {
var extendArr = dict.get('Extend'); var extendArr = dict.getArray('Extend');
extendStart = extendArr[0]; extendStart = extendArr[0];
extendEnd = extendArr[1]; extendEnd = extendArr[1];
} }
@ -44996,7 +44996,7 @@ Shadings.Mesh = (function MeshClosure() {
this.matrix = matrix; this.matrix = matrix;
this.shadingType = dict.get('ShadingType'); this.shadingType = dict.get('ShadingType');
this.type = 'Pattern'; this.type = 'Pattern';
this.bbox = dict.get('BBox'); this.bbox = dict.getArray('BBox');
var cs = dict.get('ColorSpace', 'CS'); var cs = dict.get('ColorSpace', 'CS');
cs = ColorSpace.parse(cs, xref, res); cs = ColorSpace.parse(cs, xref, res);
this.cs = cs; this.cs = cs;
@ -45014,7 +45014,7 @@ Shadings.Mesh = (function MeshClosure() {
bitsPerCoordinate: dict.get('BitsPerCoordinate'), bitsPerCoordinate: dict.get('BitsPerCoordinate'),
bitsPerComponent: dict.get('BitsPerComponent'), bitsPerComponent: dict.get('BitsPerComponent'),
bitsPerFlag: dict.get('BitsPerFlag'), bitsPerFlag: dict.get('BitsPerFlag'),
decode: dict.get('Decode'), decode: dict.getArray('Decode'),
colorFn: fn, colorFn: fn,
colorSpace: cs, colorSpace: cs,
numComps: fn ? 1 : cs.numComps numComps: fn ? 1 : cs.numComps
@ -45081,8 +45081,8 @@ Shadings.Dummy = (function DummyClosure() {
})(); })();
function getTilingPatternIR(operatorList, dict, args) { function getTilingPatternIR(operatorList, dict, args) {
var matrix = dict.get('Matrix'); var matrix = dict.getArray('Matrix');
var bbox = dict.get('BBox'); var bbox = dict.getArray('BBox');
var xstep = dict.get('XStep'); var xstep = dict.get('XStep');
var ystep = dict.get('YStep'); var ystep = dict.get('YStep');
var paintType = dict.get('PaintType'); var paintType = dict.get('PaintType');
@ -45216,7 +45216,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
function NativeImageDecoder_isSupported(image, xref, res) { function NativeImageDecoder_isSupported(image, xref, res) {
var cs = ColorSpace.parse(image.dict.get('ColorSpace', 'CS'), xref, res); var cs = ColorSpace.parse(image.dict.get('ColorSpace', 'CS'), xref, res);
return (cs.name === 'DeviceGray' || cs.name === 'DeviceRGB') && return (cs.name === 'DeviceGray' || cs.name === 'DeviceRGB') &&
cs.isDefaultDecode(image.dict.get('Decode', 'D')); cs.isDefaultDecode(image.dict.getArray('Decode', 'D'));
}; };
/** /**
* Checks if the image can be decoded by the browser. * Checks if the image can be decoded by the browser.
@ -45225,7 +45225,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
function NativeImageDecoder_isDecodable(image, xref, res) { function NativeImageDecoder_isDecodable(image, xref, res) {
var cs = ColorSpace.parse(image.dict.get('ColorSpace', 'CS'), xref, res); var cs = ColorSpace.parse(image.dict.get('ColorSpace', 'CS'), xref, res);
return (cs.numComps === 1 || cs.numComps === 3) && return (cs.numComps === 1 || cs.numComps === 3) &&
cs.isDefaultDecode(image.dict.get('Decode', 'D')); cs.isDefaultDecode(image.dict.getArray('Decode', 'D'));
}; };
function PartialEvaluator(pdfManager, xref, handler, pageIndex, function PartialEvaluator(pdfManager, xref, handler, pageIndex,
@ -45415,7 +45415,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
var height = dict.get('Height', 'H'); var height = dict.get('Height', 'H');
var bitStrideLength = (width + 7) >> 3; var bitStrideLength = (width + 7) >> 3;
var imgArray = image.getBytes(bitStrideLength * height); var imgArray = image.getBytes(bitStrideLength * height);
var decode = dict.get('Decode', 'D'); var decode = dict.getArray('Decode', 'D');
var inverseDecode = (!!decode && decode[0] > 0); var inverseDecode = (!!decode && decode[0] > 0);
imgData = PDFImage.createMask(imgArray, width, height, imgData = PDFImage.createMask(imgArray, width, height,
@ -45856,7 +45856,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
dict, operatorList, task); dict, operatorList, task);
} else if (typeNum === SHADING_PATTERN) { } else if (typeNum === SHADING_PATTERN) {
var shading = dict.get('Shading'); var shading = dict.get('Shading');
var matrix = dict.get('Matrix'); var matrix = dict.getArray('Matrix');
pattern = Pattern.parseShading(shading, matrix, xref, resources, pattern = Pattern.parseShading(shading, matrix, xref, resources,
this.handler); this.handler);
operatorList.addOp(fn, pattern.getIR()); operatorList.addOp(fn, pattern.getIR());
@ -46637,7 +46637,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
} }
stateManager.save(); stateManager.save();
var matrix = xobj.dict.get('Matrix'); var matrix = xobj.dict.getArray('Matrix');
if (isArray(matrix) && matrix.length === 6) { if (isArray(matrix) && matrix.length === 6) {
stateManager.transform(matrix); stateManager.transform(matrix);
} }
@ -47234,7 +47234,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
// is a tagged pdf. Create a barbebones one to get by. // is a tagged pdf. Create a barbebones one to get by.
descriptor = new Dict(null); descriptor = new Dict(null);
descriptor.set('FontName', Name.get(type)); descriptor.set('FontName', Name.get(type));
descriptor.set('FontBBox', dict.get('FontBBox')); descriptor.set('FontBBox', dict.getArray('FontBBox'));
} else { } else {
// Before PDF 1.5 if the font was one of the base 14 fonts, having a // Before PDF 1.5 if the font was one of the base 14 fonts, having a
// FontDescriptor was not required. // FontDescriptor was not required.
@ -47336,10 +47336,10 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
composite: composite, composite: composite,
wideChars: composite, wideChars: composite,
fixedPitch: false, fixedPitch: false,
fontMatrix: (dict.get('FontMatrix') || FONT_IDENTITY_MATRIX), fontMatrix: (dict.getArray('FontMatrix') || FONT_IDENTITY_MATRIX),
firstChar: firstChar || 0, firstChar: firstChar || 0,
lastChar: (lastChar || maxCharIndex), lastChar: (lastChar || maxCharIndex),
bbox: descriptor.get('FontBBox'), bbox: descriptor.getArray('FontBBox'),
ascent: descriptor.get('Ascent'), ascent: descriptor.get('Ascent'),
descent: descriptor.get('Descent'), descent: descriptor.get('Descent'),
xHeight: descriptor.get('XHeight'), xHeight: descriptor.get('XHeight'),
@ -48451,7 +48451,7 @@ var Annotation = (function AnnotationClosure() {
this.setFlags(dict.get('F')); this.setFlags(dict.get('F'));
this.setRectangle(dict.getArray('Rect')); this.setRectangle(dict.getArray('Rect'));
this.setColor(dict.get('C')); this.setColor(dict.getArray('C'));
this.setBorderStyle(dict); this.setBorderStyle(dict);
this.appearance = getDefaultAppearance(dict); this.appearance = getDefaultAppearance(dict);
@ -48602,10 +48602,10 @@ var Annotation = (function AnnotationClosure() {
dictType.name === 'Border')) { dictType.name === 'Border')) {
this.borderStyle.setWidth(dict.get('W')); this.borderStyle.setWidth(dict.get('W'));
this.borderStyle.setStyle(dict.get('S')); this.borderStyle.setStyle(dict.get('S'));
this.borderStyle.setDashArray(dict.get('D')); this.borderStyle.setDashArray(dict.getArray('D'));
} }
} else if (borderStyle.has('Border')) { } else if (borderStyle.has('Border')) {
var array = borderStyle.get('Border'); var array = borderStyle.getArray('Border');
if (isArray(array) && array.length >= 3) { if (isArray(array) && array.length >= 3) {
this.borderStyle.setHorizontalCornerRadius(array[0]); this.borderStyle.setHorizontalCornerRadius(array[0]);
this.borderStyle.setVerticalCornerRadius(array[1]); this.borderStyle.setVerticalCornerRadius(array[1]);
@ -48677,8 +48677,8 @@ var Annotation = (function AnnotationClosure() {
// ProcSet // ProcSet
// Properties // Properties
]); ]);
var bbox = appearanceDict.get('BBox') || [0, 0, 1, 1]; var bbox = appearanceDict.getArray('BBox') || [0, 0, 1, 1];
var matrix = appearanceDict.get('Matrix') || [1, 0, 0, 1, 0 ,0]; var matrix = appearanceDict.getArray('Matrix') || [1, 0, 0, 1, 0 ,0];
var transform = getTransformMatrix(data.rect, bbox, matrix); var transform = getTransformMatrix(data.rect, bbox, matrix);
var self = this; var self = this;
@ -49097,7 +49097,7 @@ var PopupAnnotation = (function PopupAnnotationClosure() {
// Fall back to the default background color. // Fall back to the default background color.
this.data.color = null; this.data.color = null;
} else { } else {
this.setColor(parentItem.get('C')); this.setColor(parentItem.getArray('C'));
this.data.color = this.color; this.data.color = this.color;
} }
} }

4
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.5.248'; var pdfjsVersion = '1.5.250';
var pdfjsBuild = '69cf8c5'; var pdfjsBuild = 'c1c199d';
var pdfjsFilePath = var pdfjsFilePath =
typeof document !== 'undefined' && document.currentScript ? typeof document !== 'undefined' && document.currentScript ?

98
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.5.248'; var pdfjsVersion = '1.5.250';
var pdfjsBuild = '69cf8c5'; var pdfjsBuild = 'c1c199d';
var pdfjsFilePath = var pdfjsFilePath =
typeof document !== 'undefined' && document.currentScript ? typeof document !== 'undefined' && document.currentScript ?
@ -20586,7 +20586,7 @@ var JpegStream = (function JpegStreamClosure() {
// checking if values needs to be transformed before conversion // checking if values needs to be transformed before conversion
if (this.forceRGB && this.dict && isArray(this.dict.get('Decode'))) { if (this.forceRGB && this.dict && isArray(this.dict.get('Decode'))) {
var decodeArr = this.dict.get('Decode'); var decodeArr = this.dict.getArray('Decode');
var bitsPerComponent = this.dict.get('BitsPerComponent') || 8; var bitsPerComponent = this.dict.get('BitsPerComponent') || 8;
var decodeArrLength = decodeArr.length; var decodeArrLength = decodeArr.length;
var transform = new Int32Array(decodeArrLength); var transform = new Int32Array(decodeArrLength);
@ -20726,8 +20726,8 @@ var Jbig2Stream = (function Jbig2StreamClosure() {
var jbig2Image = new Jbig2Image(); var jbig2Image = new Jbig2Image();
var chunks = [], xref = this.dict.xref; var chunks = [];
var decodeParams = xref.fetchIfRef(this.dict.get('DecodeParms')); var decodeParams = this.dict.getArray('DecodeParms');
// According to the PDF specification, DecodeParms can be either // According to the PDF specification, DecodeParms can be either
// a dictionary, or an array whose elements are dictionaries. // a dictionary, or an array whose elements are dictionaries.
@ -20736,7 +20736,7 @@ var Jbig2Stream = (function Jbig2StreamClosure() {
warn('JBIG2 - \'DecodeParms\' array with multiple elements ' + warn('JBIG2 - \'DecodeParms\' array with multiple elements ' +
'not supported.'); 'not supported.');
} }
decodeParams = xref.fetchIfRef(decodeParams[0]); decodeParams = decodeParams[0];
} }
if (decodeParams && decodeParams.has('JBIG2Globals')) { if (decodeParams && decodeParams.has('JBIG2Globals')) {
var globalsStream = decodeParams.get('JBIG2Globals'); var globalsStream = decodeParams.get('JBIG2Globals');
@ -31393,8 +31393,8 @@ var PDFFunction = (function PDFFunctionClosure() {
} }
return out; return out;
} }
var domain = dict.get('Domain'); var domain = dict.getArray('Domain');
var range = dict.get('Range'); var range = dict.getArray('Range');
if (!domain || !range) { if (!domain || !range) {
error('No domain or range'); error('No domain or range');
@ -31415,7 +31415,7 @@ var PDFFunction = (function PDFFunctionClosure() {
info('No support for cubic spline interpolation: ' + order); info('No support for cubic spline interpolation: ' + order);
} }
var encode = dict.get('Encode'); var encode = dict.getArray('Encode');
if (!encode) { if (!encode) {
encode = []; encode = [];
for (var i = 0; i < inputSize; ++i) { for (var i = 0; i < inputSize; ++i) {
@ -31425,7 +31425,7 @@ var PDFFunction = (function PDFFunctionClosure() {
} }
encode = toMultiArray(encode); encode = toMultiArray(encode);
var decode = dict.get('Decode'); var decode = dict.getArray('Decode');
if (!decode) { if (!decode) {
decode = range; decode = range;
} else { } else {
@ -31527,8 +31527,8 @@ var PDFFunction = (function PDFFunctionClosure() {
constructInterpolated: function PDFFunction_constructInterpolated(str, constructInterpolated: function PDFFunction_constructInterpolated(str,
dict) { dict) {
var c0 = dict.get('C0') || [0]; var c0 = dict.getArray('C0') || [0];
var c1 = dict.get('C1') || [1]; var c1 = dict.getArray('C1') || [1];
var n = dict.get('N'); var n = dict.get('N');
if (!isArray(c0) || !isArray(c1)) { if (!isArray(c0) || !isArray(c1)) {
@ -31563,7 +31563,7 @@ var PDFFunction = (function PDFFunctionClosure() {
}, },
constructStiched: function PDFFunction_constructStiched(fn, dict, xref) { constructStiched: function PDFFunction_constructStiched(fn, dict, xref) {
var domain = dict.get('Domain'); var domain = dict.getArray('Domain');
if (!domain) { if (!domain) {
error('No domain'); error('No domain');
@ -31580,8 +31580,8 @@ var PDFFunction = (function PDFFunctionClosure() {
fns.push(PDFFunction.getIR(xref, xref.fetchIfRef(fnRefs[i]))); fns.push(PDFFunction.getIR(xref, xref.fetchIfRef(fnRefs[i])));
} }
var bounds = dict.get('Bounds'); var bounds = dict.getArray('Bounds');
var encode = dict.get('Encode'); var encode = dict.getArray('Encode');
return [CONSTRUCT_STICHED, domain, bounds, encode, fns]; return [CONSTRUCT_STICHED, domain, bounds, encode, fns];
}, },
@ -31643,8 +31643,8 @@ var PDFFunction = (function PDFFunctionClosure() {
constructPostScript: function PDFFunction_constructPostScript(fn, dict, constructPostScript: function PDFFunction_constructPostScript(fn, dict,
xref) { xref) {
var domain = dict.get('Domain'); var domain = dict.getArray('Domain');
var range = dict.get('Range'); var range = dict.getArray('Range');
if (!domain) { if (!domain) {
error('No domain.'); error('No domain.');
@ -32718,16 +32718,16 @@ var ColorSpace = (function ColorSpaceClosure() {
return 'DeviceCmykCS'; return 'DeviceCmykCS';
case 'CalGray': case 'CalGray':
params = xref.fetchIfRef(cs[1]); params = xref.fetchIfRef(cs[1]);
whitePoint = params.get('WhitePoint'); whitePoint = params.getArray('WhitePoint');
blackPoint = params.get('BlackPoint'); blackPoint = params.getArray('BlackPoint');
gamma = params.get('Gamma'); gamma = params.get('Gamma');
return ['CalGrayCS', whitePoint, blackPoint, gamma]; return ['CalGrayCS', whitePoint, blackPoint, gamma];
case 'CalRGB': case 'CalRGB':
params = xref.fetchIfRef(cs[1]); params = xref.fetchIfRef(cs[1]);
whitePoint = params.get('WhitePoint'); whitePoint = params.getArray('WhitePoint');
blackPoint = params.get('BlackPoint'); blackPoint = params.getArray('BlackPoint');
gamma = params.get('Gamma'); gamma = params.getArray('Gamma');
var matrix = params.get('Matrix'); var matrix = params.getArray('Matrix');
return ['CalRGBCS', whitePoint, blackPoint, gamma, matrix]; return ['CalRGBCS', whitePoint, blackPoint, gamma, matrix];
case 'ICCBased': case 'ICCBased':
var stream = xref.fetchIfRef(cs[1]); var stream = xref.fetchIfRef(cs[1]);
@ -32781,9 +32781,9 @@ var ColorSpace = (function ColorSpaceClosure() {
return ['AlternateCS', numComps, alt, tintFnIR]; return ['AlternateCS', numComps, alt, tintFnIR];
case 'Lab': case 'Lab':
params = xref.fetchIfRef(cs[1]); params = xref.fetchIfRef(cs[1]);
whitePoint = params.get('WhitePoint'); whitePoint = params.getArray('WhitePoint');
blackPoint = params.get('BlackPoint'); blackPoint = params.getArray('BlackPoint');
var range = params.get('Range'); var range = params.getArray('Range');
return ['LabCS', whitePoint, blackPoint, range]; return ['LabCS', whitePoint, blackPoint, range];
default: default:
error('unimplemented color space object "' + mode + '"'); error('unimplemented color space object "' + mode + '"');
@ -33856,7 +33856,7 @@ var PDFImage = (function PDFImageClosure() {
this.numComps = this.colorSpace.numComps; this.numComps = this.colorSpace.numComps;
} }
this.decode = dict.get('Decode', 'D'); this.decode = dict.getArray('Decode', 'D');
this.needsDecode = false; this.needsDecode = false;
if (this.decode && if (this.decode &&
((this.colorSpace && !this.colorSpace.isDefaultDecode(this.decode)) || ((this.colorSpace && !this.colorSpace.isDefaultDecode(this.decode)) ||
@ -34507,7 +34507,7 @@ var Catalog = (function CatalogClosure() {
var title = outlineDict.get('Title'); var title = outlineDict.get('Title');
var flags = outlineDict.get('F') || 0; var flags = outlineDict.get('F') || 0;
var color = outlineDict.get('C'), rgbColor = blackColor; var color = outlineDict.getArray('C'), rgbColor = blackColor;
// We only need to parse the color when it's valid, and non-default. // We only need to parse the color when it's valid, and non-default.
if (isArray(color) && color.length === 3 && if (isArray(color) && color.length === 3 &&
(color[0] !== 0 || color[1] !== 0 || color[2] !== 0)) { (color[0] !== 0 || color[1] !== 0 || color[2] !== 0)) {
@ -36033,7 +36033,7 @@ Shadings.SMALL_NUMBER = 1e-6;
Shadings.RadialAxial = (function RadialAxialClosure() { Shadings.RadialAxial = (function RadialAxialClosure() {
function RadialAxial(dict, matrix, xref, res) { function RadialAxial(dict, matrix, xref, res) {
this.matrix = matrix; this.matrix = matrix;
this.coordsArr = dict.get('Coords'); this.coordsArr = dict.getArray('Coords');
this.shadingType = dict.get('ShadingType'); this.shadingType = dict.get('ShadingType');
this.type = 'Pattern'; this.type = 'Pattern';
var cs = dict.get('ColorSpace', 'CS'); var cs = dict.get('ColorSpace', 'CS');
@ -36042,14 +36042,14 @@ Shadings.RadialAxial = (function RadialAxialClosure() {
var t0 = 0.0, t1 = 1.0; var t0 = 0.0, t1 = 1.0;
if (dict.has('Domain')) { if (dict.has('Domain')) {
var domainArr = dict.get('Domain'); var domainArr = dict.getArray('Domain');
t0 = domainArr[0]; t0 = domainArr[0];
t1 = domainArr[1]; t1 = domainArr[1];
} }
var extendStart = false, extendEnd = false; var extendStart = false, extendEnd = false;
if (dict.has('Extend')) { if (dict.has('Extend')) {
var extendArr = dict.get('Extend'); var extendArr = dict.getArray('Extend');
extendStart = extendArr[0]; extendStart = extendArr[0];
extendEnd = extendArr[1]; extendEnd = extendArr[1];
} }
@ -36654,7 +36654,7 @@ Shadings.Mesh = (function MeshClosure() {
this.matrix = matrix; this.matrix = matrix;
this.shadingType = dict.get('ShadingType'); this.shadingType = dict.get('ShadingType');
this.type = 'Pattern'; this.type = 'Pattern';
this.bbox = dict.get('BBox'); this.bbox = dict.getArray('BBox');
var cs = dict.get('ColorSpace', 'CS'); var cs = dict.get('ColorSpace', 'CS');
cs = ColorSpace.parse(cs, xref, res); cs = ColorSpace.parse(cs, xref, res);
this.cs = cs; this.cs = cs;
@ -36672,7 +36672,7 @@ Shadings.Mesh = (function MeshClosure() {
bitsPerCoordinate: dict.get('BitsPerCoordinate'), bitsPerCoordinate: dict.get('BitsPerCoordinate'),
bitsPerComponent: dict.get('BitsPerComponent'), bitsPerComponent: dict.get('BitsPerComponent'),
bitsPerFlag: dict.get('BitsPerFlag'), bitsPerFlag: dict.get('BitsPerFlag'),
decode: dict.get('Decode'), decode: dict.getArray('Decode'),
colorFn: fn, colorFn: fn,
colorSpace: cs, colorSpace: cs,
numComps: fn ? 1 : cs.numComps numComps: fn ? 1 : cs.numComps
@ -36739,8 +36739,8 @@ Shadings.Dummy = (function DummyClosure() {
})(); })();
function getTilingPatternIR(operatorList, dict, args) { function getTilingPatternIR(operatorList, dict, args) {
var matrix = dict.get('Matrix'); var matrix = dict.getArray('Matrix');
var bbox = dict.get('BBox'); var bbox = dict.getArray('BBox');
var xstep = dict.get('XStep'); var xstep = dict.get('XStep');
var ystep = dict.get('YStep'); var ystep = dict.get('YStep');
var paintType = dict.get('PaintType'); var paintType = dict.get('PaintType');
@ -36874,7 +36874,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
function NativeImageDecoder_isSupported(image, xref, res) { function NativeImageDecoder_isSupported(image, xref, res) {
var cs = ColorSpace.parse(image.dict.get('ColorSpace', 'CS'), xref, res); var cs = ColorSpace.parse(image.dict.get('ColorSpace', 'CS'), xref, res);
return (cs.name === 'DeviceGray' || cs.name === 'DeviceRGB') && return (cs.name === 'DeviceGray' || cs.name === 'DeviceRGB') &&
cs.isDefaultDecode(image.dict.get('Decode', 'D')); cs.isDefaultDecode(image.dict.getArray('Decode', 'D'));
}; };
/** /**
* Checks if the image can be decoded by the browser. * Checks if the image can be decoded by the browser.
@ -36883,7 +36883,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
function NativeImageDecoder_isDecodable(image, xref, res) { function NativeImageDecoder_isDecodable(image, xref, res) {
var cs = ColorSpace.parse(image.dict.get('ColorSpace', 'CS'), xref, res); var cs = ColorSpace.parse(image.dict.get('ColorSpace', 'CS'), xref, res);
return (cs.numComps === 1 || cs.numComps === 3) && return (cs.numComps === 1 || cs.numComps === 3) &&
cs.isDefaultDecode(image.dict.get('Decode', 'D')); cs.isDefaultDecode(image.dict.getArray('Decode', 'D'));
}; };
function PartialEvaluator(pdfManager, xref, handler, pageIndex, function PartialEvaluator(pdfManager, xref, handler, pageIndex,
@ -37073,7 +37073,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
var height = dict.get('Height', 'H'); var height = dict.get('Height', 'H');
var bitStrideLength = (width + 7) >> 3; var bitStrideLength = (width + 7) >> 3;
var imgArray = image.getBytes(bitStrideLength * height); var imgArray = image.getBytes(bitStrideLength * height);
var decode = dict.get('Decode', 'D'); var decode = dict.getArray('Decode', 'D');
var inverseDecode = (!!decode && decode[0] > 0); var inverseDecode = (!!decode && decode[0] > 0);
imgData = PDFImage.createMask(imgArray, width, height, imgData = PDFImage.createMask(imgArray, width, height,
@ -37514,7 +37514,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
dict, operatorList, task); dict, operatorList, task);
} else if (typeNum === SHADING_PATTERN) { } else if (typeNum === SHADING_PATTERN) {
var shading = dict.get('Shading'); var shading = dict.get('Shading');
var matrix = dict.get('Matrix'); var matrix = dict.getArray('Matrix');
pattern = Pattern.parseShading(shading, matrix, xref, resources, pattern = Pattern.parseShading(shading, matrix, xref, resources,
this.handler); this.handler);
operatorList.addOp(fn, pattern.getIR()); operatorList.addOp(fn, pattern.getIR());
@ -38295,7 +38295,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
} }
stateManager.save(); stateManager.save();
var matrix = xobj.dict.get('Matrix'); var matrix = xobj.dict.getArray('Matrix');
if (isArray(matrix) && matrix.length === 6) { if (isArray(matrix) && matrix.length === 6) {
stateManager.transform(matrix); stateManager.transform(matrix);
} }
@ -38892,7 +38892,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
// is a tagged pdf. Create a barbebones one to get by. // is a tagged pdf. Create a barbebones one to get by.
descriptor = new Dict(null); descriptor = new Dict(null);
descriptor.set('FontName', Name.get(type)); descriptor.set('FontName', Name.get(type));
descriptor.set('FontBBox', dict.get('FontBBox')); descriptor.set('FontBBox', dict.getArray('FontBBox'));
} else { } else {
// Before PDF 1.5 if the font was one of the base 14 fonts, having a // Before PDF 1.5 if the font was one of the base 14 fonts, having a
// FontDescriptor was not required. // FontDescriptor was not required.
@ -38994,10 +38994,10 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
composite: composite, composite: composite,
wideChars: composite, wideChars: composite,
fixedPitch: false, fixedPitch: false,
fontMatrix: (dict.get('FontMatrix') || FONT_IDENTITY_MATRIX), fontMatrix: (dict.getArray('FontMatrix') || FONT_IDENTITY_MATRIX),
firstChar: firstChar || 0, firstChar: firstChar || 0,
lastChar: (lastChar || maxCharIndex), lastChar: (lastChar || maxCharIndex),
bbox: descriptor.get('FontBBox'), bbox: descriptor.getArray('FontBBox'),
ascent: descriptor.get('Ascent'), ascent: descriptor.get('Ascent'),
descent: descriptor.get('Descent'), descent: descriptor.get('Descent'),
xHeight: descriptor.get('XHeight'), xHeight: descriptor.get('XHeight'),
@ -40109,7 +40109,7 @@ var Annotation = (function AnnotationClosure() {
this.setFlags(dict.get('F')); this.setFlags(dict.get('F'));
this.setRectangle(dict.getArray('Rect')); this.setRectangle(dict.getArray('Rect'));
this.setColor(dict.get('C')); this.setColor(dict.getArray('C'));
this.setBorderStyle(dict); this.setBorderStyle(dict);
this.appearance = getDefaultAppearance(dict); this.appearance = getDefaultAppearance(dict);
@ -40260,10 +40260,10 @@ var Annotation = (function AnnotationClosure() {
dictType.name === 'Border')) { dictType.name === 'Border')) {
this.borderStyle.setWidth(dict.get('W')); this.borderStyle.setWidth(dict.get('W'));
this.borderStyle.setStyle(dict.get('S')); this.borderStyle.setStyle(dict.get('S'));
this.borderStyle.setDashArray(dict.get('D')); this.borderStyle.setDashArray(dict.getArray('D'));
} }
} else if (borderStyle.has('Border')) { } else if (borderStyle.has('Border')) {
var array = borderStyle.get('Border'); var array = borderStyle.getArray('Border');
if (isArray(array) && array.length >= 3) { if (isArray(array) && array.length >= 3) {
this.borderStyle.setHorizontalCornerRadius(array[0]); this.borderStyle.setHorizontalCornerRadius(array[0]);
this.borderStyle.setVerticalCornerRadius(array[1]); this.borderStyle.setVerticalCornerRadius(array[1]);
@ -40335,8 +40335,8 @@ var Annotation = (function AnnotationClosure() {
// ProcSet // ProcSet
// Properties // Properties
]); ]);
var bbox = appearanceDict.get('BBox') || [0, 0, 1, 1]; var bbox = appearanceDict.getArray('BBox') || [0, 0, 1, 1];
var matrix = appearanceDict.get('Matrix') || [1, 0, 0, 1, 0 ,0]; var matrix = appearanceDict.getArray('Matrix') || [1, 0, 0, 1, 0 ,0];
var transform = getTransformMatrix(data.rect, bbox, matrix); var transform = getTransformMatrix(data.rect, bbox, matrix);
var self = this; var self = this;
@ -40755,7 +40755,7 @@ var PopupAnnotation = (function PopupAnnotationClosure() {
// Fall back to the default background color. // Fall back to the default background color.
this.data.color = null; this.data.color = null;
} else { } else {
this.setColor(parentItem.get('C')); this.setColor(parentItem.getArray('C'));
this.data.color = this.color; this.data.color = this.color;
} }
} }

2
package.json

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