Browse Source

PDF.js version 1.6.426 - See mozilla/pdf.js@098acb126958e8f0eb18399f1182a945e5164fd2

master v1.6.426
Pdf Bot 8 years ago
parent
commit
c095e2dd65
  1. 2
      bower.json
  2. 70
      build/pdf.combined.js
  3. 13
      build/pdf.js
  4. 2
      build/pdf.min.js
  5. 61
      build/pdf.worker.js
  6. 2
      build/pdf.worker.min.js
  7. 2
      package.json
  8. 3
      web/compatibility.js
  9. 49
      web/pdf_viewer.js

2
bower.json

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

70
build/pdf.combined.js

@ -23,8 +23,8 @@
} }
}(this, function (exports) { }(this, function (exports) {
'use strict'; 'use strict';
var pdfjsVersion = '1.6.424'; var pdfjsVersion = '1.6.426';
var pdfjsBuild = '049d7fa'; var pdfjsBuild = '098acb1';
var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : null; var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : null;
var pdfjsLibs = {}; var pdfjsLibs = {};
(function pdfjsWrapper() { (function pdfjsWrapper() {
@ -6495,10 +6495,9 @@
return (value - 247) * 256 + dict[pos++] + 108; return (value - 247) * 256 + dict[pos++] + 108;
} else if (value >= 251 && value <= 254) { } else if (value >= 251 && value <= 254) {
return -((value - 251) * 256) - dict[pos++] - 108; return -((value - 251) * 256) - dict[pos++] - 108;
} else {
warn('CFFParser_parseDict: "' + value + '" is a reserved command.');
return NaN;
} }
warn('CFFParser_parseDict: "' + value + '" is a reserved command.');
return NaN;
} }
function parseFloatOperand() { function parseFloatOperand() {
var str = ''; var str = '';
@ -7780,9 +7779,8 @@
encodeNumber: function CFFCompiler_encodeNumber(value) { encodeNumber: function CFFCompiler_encodeNumber(value) {
if (parseFloat(value) === parseInt(value, 10) && !isNaN(value)) { if (parseFloat(value) === parseInt(value, 10) && !isNaN(value)) {
return this.encodeInteger(value); return this.encodeInteger(value);
} else {
return this.encodeFloat(value);
} }
return this.encodeFloat(value);
}, },
encodeFloat: function CFFCompiler_encodeFloat(num) { encodeFloat: function CFFCompiler_encodeFloat(num) {
var value = num.toString(); var value = num.toString();
@ -15070,12 +15068,11 @@
return false; return false;
} }
return true; return true;
} else {
if (!this.adobe && this.colorTransform === 1) {
return true;
}
return false;
} }
if (!this.adobe && this.colorTransform === 1) {
return true;
}
return false;
}, },
_convertYccToRgb: function convertYccToRgb(data) { _convertYccToRgb: function convertYccToRgb(data) {
var Y, Cb, Cr; var Y, Cb, Cr;
@ -15159,9 +15156,8 @@
if (this._isColorConversionNeeded()) { if (this._isColorConversionNeeded()) {
if (forceRGBoutput) { if (forceRGBoutput) {
return this._convertYcckToRgb(data); return this._convertYcckToRgb(data);
} else {
return this._convertYcckToCmyk(data);
} }
return this._convertYcckToCmyk(data);
} else if (forceRGBoutput) { } else if (forceRGBoutput) {
return this._convertCmykToRgb(data); return this._convertCmykToRgb(data);
} }
@ -31293,9 +31289,8 @@
return new RadioButtonWidgetAnnotationElement(parameters); return new RadioButtonWidgetAnnotationElement(parameters);
} else if (parameters.data.checkBox) { } else if (parameters.data.checkBox) {
return new CheckboxWidgetAnnotationElement(parameters); return new CheckboxWidgetAnnotationElement(parameters);
} else {
warn('Unimplemented button widget annotation: pushbutton');
} }
warn('Unimplemented button widget annotation: pushbutton');
break; break;
case 'Ch': case 'Ch':
return new ChoiceWidgetAnnotationElement(parameters); return new ChoiceWidgetAnnotationElement(parameters);
@ -37449,9 +37444,8 @@
0 0
]; ];
return new TrueTypeCompiled(parseGlyfTable(glyf, loca, indexToLocFormat), cmap, fontMatrix); return new TrueTypeCompiled(parseGlyfTable(glyf, loca, indexToLocFormat), cmap, fontMatrix);
} else {
return new Type2Compiled(cff, cmap, font.fontMatrix, font.glyphNameMap);
} }
return new Type2Compiled(cff, cmap, font.fontMatrix, font.glyphNameMap);
} }
}; };
}(); }();
@ -47604,9 +47598,8 @@
var objs = this.objs; var objs = this.objs;
if (!objs[objId]) { if (!objs[objId]) {
return false; return false;
} else {
return objs[objId].resolved;
} }
return objs[objId].resolved;
}, },
hasData: function PDFObjects_hasData(objId) { hasData: function PDFObjects_hasData(objId) {
return this.isResolved(objId); return this.isResolved(objId);
@ -47615,9 +47608,8 @@
var objs = this.objs; var objs = this.objs;
if (!objs[objId] || !objs[objId].resolved) { if (!objs[objId] || !objs[objId].resolved) {
return null; return null;
} else {
return objs[objId].data;
} }
return objs[objId].data;
}, },
clear: function PDFObjects_clear() { clear: function PDFObjects_clear() {
this.objs = Object.create(null); this.objs = Object.create(null);
@ -48710,11 +48702,13 @@
} }
} }
function fn_g(x) { function fn_g(x) {
var result;
if (x >= 6 / 29) { if (x >= 6 / 29) {
return x * x * x; result = x * x * x;
} else { } else {
return 108 / 841 * (x - 4 / 29); result = 108 / 841 * (x - 4 / 29);
} }
return result;
} }
function decode(value, high1, low2, high2) { function decode(value, high1, low2, high2) {
return low2 + value * (high2 - low2) / high1; return low2 + value * (high2 - low2) / high1;
@ -48918,9 +48912,8 @@
function handleImageData(image, nativeDecoder) { function handleImageData(image, nativeDecoder) {
if (nativeDecoder && nativeDecoder.canDecode(image)) { if (nativeDecoder && nativeDecoder.canDecode(image)) {
return nativeDecoder.decode(image); return nativeDecoder.decode(image);
} else {
return Promise.resolve(image);
} }
return Promise.resolve(image);
} }
function decodeAndClamp(value, addend, coefficient, max) { function decodeAndClamp(value, addend, coefficient, max) {
value = addend + value * coefficient; value = addend + value * coefficient;
@ -50672,9 +50665,8 @@
return dict.get('Mac'); return dict.get('Mac');
} else if (dict.has('DOS')) { } else if (dict.has('DOS')) {
return dict.get('DOS'); return dict.get('DOS');
} else {
return null;
} }
return null;
} }
FileSpec.prototype = { FileSpec.prototype = {
get filename() { get filename() {
@ -52297,9 +52289,8 @@
pattern = Pattern.parseShading(shading, matrix, xref, resources, this.handler); pattern = Pattern.parseShading(shading, matrix, xref, resources, this.handler);
operatorList.addOp(fn, pattern.getIR()); operatorList.addOp(fn, pattern.getIR());
return Promise.resolve(); return Promise.resolve();
} else {
return Promise.reject('Unknown PatternType: ' + typeNum);
} }
return Promise.reject('Unknown PatternType: ' + typeNum);
} }
operatorList.addOp(fn, args); operatorList.addOp(fn, args);
return Promise.resolve(); return Promise.resolve();
@ -54253,17 +54244,16 @@
operation.fn = fn; operation.fn = fn;
operation.args = args; operation.args = args;
return true; return true;
} else { }
if (isEOF(obj)) { if (isEOF(obj)) {
return false; return false;
} }
if (obj !== null) { if (obj !== null) {
if (args === null) { if (args === null) {
args = []; args = [];
}
args.push(obj);
assert(args.length <= 33, 'Too many arguments');
} }
args.push(obj);
assert(args.length <= 33, 'Too many arguments');
} }
} }
}, },

13
build/pdf.js

@ -23,8 +23,8 @@
} }
}(this, function (exports) { }(this, function (exports) {
'use strict'; 'use strict';
var pdfjsVersion = '1.6.424'; var pdfjsVersion = '1.6.426';
var pdfjsBuild = '049d7fa'; var pdfjsBuild = '098acb1';
var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : null; var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : null;
var pdfjsLibs = {}; var pdfjsLibs = {};
(function pdfjsWrapper() { (function pdfjsWrapper() {
@ -3805,9 +3805,8 @@
return new RadioButtonWidgetAnnotationElement(parameters); return new RadioButtonWidgetAnnotationElement(parameters);
} else if (parameters.data.checkBox) { } else if (parameters.data.checkBox) {
return new CheckboxWidgetAnnotationElement(parameters); return new CheckboxWidgetAnnotationElement(parameters);
} else {
warn('Unimplemented button widget annotation: pushbutton');
} }
warn('Unimplemented button widget annotation: pushbutton');
break; break;
case 'Ch': case 'Ch':
return new ChoiceWidgetAnnotationElement(parameters); return new ChoiceWidgetAnnotationElement(parameters);
@ -8745,9 +8744,8 @@
var objs = this.objs; var objs = this.objs;
if (!objs[objId]) { if (!objs[objId]) {
return false; return false;
} else {
return objs[objId].resolved;
} }
return objs[objId].resolved;
}, },
hasData: function PDFObjects_hasData(objId) { hasData: function PDFObjects_hasData(objId) {
return this.isResolved(objId); return this.isResolved(objId);
@ -8756,9 +8754,8 @@
var objs = this.objs; var objs = this.objs;
if (!objs[objId] || !objs[objId].resolved) { if (!objs[objId] || !objs[objId].resolved) {
return null; return null;
} else {
return objs[objId].data;
} }
return objs[objId].data;
}, },
clear: function PDFObjects_clear() { clear: function PDFObjects_clear() {
this.objs = Object.create(null); this.objs = Object.create(null);

2
build/pdf.min.js vendored

File diff suppressed because one or more lines are too long

61
build/pdf.worker.js vendored

@ -23,8 +23,8 @@
} }
}(this, function (exports) { }(this, function (exports) {
'use strict'; 'use strict';
var pdfjsVersion = '1.6.424'; var pdfjsVersion = '1.6.426';
var pdfjsBuild = '049d7fa'; var pdfjsBuild = '098acb1';
var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : null; var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : null;
var pdfjsLibs = {}; var pdfjsLibs = {};
(function pdfjsWrapper() { (function pdfjsWrapper() {
@ -6495,10 +6495,9 @@
return (value - 247) * 256 + dict[pos++] + 108; return (value - 247) * 256 + dict[pos++] + 108;
} else if (value >= 251 && value <= 254) { } else if (value >= 251 && value <= 254) {
return -((value - 251) * 256) - dict[pos++] - 108; return -((value - 251) * 256) - dict[pos++] - 108;
} else {
warn('CFFParser_parseDict: "' + value + '" is a reserved command.');
return NaN;
} }
warn('CFFParser_parseDict: "' + value + '" is a reserved command.');
return NaN;
} }
function parseFloatOperand() { function parseFloatOperand() {
var str = ''; var str = '';
@ -7780,9 +7779,8 @@
encodeNumber: function CFFCompiler_encodeNumber(value) { encodeNumber: function CFFCompiler_encodeNumber(value) {
if (parseFloat(value) === parseInt(value, 10) && !isNaN(value)) { if (parseFloat(value) === parseInt(value, 10) && !isNaN(value)) {
return this.encodeInteger(value); return this.encodeInteger(value);
} else {
return this.encodeFloat(value);
} }
return this.encodeFloat(value);
}, },
encodeFloat: function CFFCompiler_encodeFloat(num) { encodeFloat: function CFFCompiler_encodeFloat(num) {
var value = num.toString(); var value = num.toString();
@ -15070,12 +15068,11 @@
return false; return false;
} }
return true; return true;
} else {
if (!this.adobe && this.colorTransform === 1) {
return true;
}
return false;
} }
if (!this.adobe && this.colorTransform === 1) {
return true;
}
return false;
}, },
_convertYccToRgb: function convertYccToRgb(data) { _convertYccToRgb: function convertYccToRgb(data) {
var Y, Cb, Cr; var Y, Cb, Cr;
@ -15159,9 +15156,8 @@
if (this._isColorConversionNeeded()) { if (this._isColorConversionNeeded()) {
if (forceRGBoutput) { if (forceRGBoutput) {
return this._convertYcckToRgb(data); return this._convertYcckToRgb(data);
} else {
return this._convertYcckToCmyk(data);
} }
return this._convertYcckToCmyk(data);
} else if (forceRGBoutput) { } else if (forceRGBoutput) {
return this._convertCmykToRgb(data); return this._convertCmykToRgb(data);
} }
@ -34415,9 +34411,8 @@
0 0
]; ];
return new TrueTypeCompiled(parseGlyfTable(glyf, loca, indexToLocFormat), cmap, fontMatrix); return new TrueTypeCompiled(parseGlyfTable(glyf, loca, indexToLocFormat), cmap, fontMatrix);
} else {
return new Type2Compiled(cff, cmap, font.fontMatrix, font.glyphNameMap);
} }
return new Type2Compiled(cff, cmap, font.fontMatrix, font.glyphNameMap);
} }
}; };
}(); }();
@ -42164,11 +42159,13 @@
} }
} }
function fn_g(x) { function fn_g(x) {
var result;
if (x >= 6 / 29) { if (x >= 6 / 29) {
return x * x * x; result = x * x * x;
} else { } else {
return 108 / 841 * (x - 4 / 29); result = 108 / 841 * (x - 4 / 29);
} }
return result;
} }
function decode(value, high1, low2, high2) { function decode(value, high1, low2, high2) {
return low2 + value * (high2 - low2) / high1; return low2 + value * (high2 - low2) / high1;
@ -42250,9 +42247,8 @@
function handleImageData(image, nativeDecoder) { function handleImageData(image, nativeDecoder) {
if (nativeDecoder && nativeDecoder.canDecode(image)) { if (nativeDecoder && nativeDecoder.canDecode(image)) {
return nativeDecoder.decode(image); return nativeDecoder.decode(image);
} else {
return Promise.resolve(image);
} }
return Promise.resolve(image);
} }
function decodeAndClamp(value, addend, coefficient, max) { function decodeAndClamp(value, addend, coefficient, max) {
value = addend + value * coefficient; value = addend + value * coefficient;
@ -44004,9 +44000,8 @@
return dict.get('Mac'); return dict.get('Mac');
} else if (dict.has('DOS')) { } else if (dict.has('DOS')) {
return dict.get('DOS'); return dict.get('DOS');
} else {
return null;
} }
return null;
} }
FileSpec.prototype = { FileSpec.prototype = {
get filename() { get filename() {
@ -45629,9 +45624,8 @@
pattern = Pattern.parseShading(shading, matrix, xref, resources, this.handler); pattern = Pattern.parseShading(shading, matrix, xref, resources, this.handler);
operatorList.addOp(fn, pattern.getIR()); operatorList.addOp(fn, pattern.getIR());
return Promise.resolve(); return Promise.resolve();
} else {
return Promise.reject('Unknown PatternType: ' + typeNum);
} }
return Promise.reject('Unknown PatternType: ' + typeNum);
} }
operatorList.addOp(fn, args); operatorList.addOp(fn, args);
return Promise.resolve(); return Promise.resolve();
@ -47585,17 +47579,16 @@
operation.fn = fn; operation.fn = fn;
operation.args = args; operation.args = args;
return true; return true;
} else { }
if (isEOF(obj)) { if (isEOF(obj)) {
return false; return false;
} }
if (obj !== null) { if (obj !== null) {
if (args === null) { if (args === null) {
args = []; args = [];
}
args.push(obj);
assert(args.length <= 33, 'Too many arguments');
} }
args.push(obj);
assert(args.length <= 33, 'Too many arguments');
} }
} }
}, },

2
build/pdf.worker.min.js vendored

File diff suppressed because one or more lines are too long

2
package.json

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

3
web/compatibility.js

@ -202,9 +202,8 @@ if (typeof PDFJS === 'undefined') {
get: function xmlHttpRequestResponseGet() { get: function xmlHttpRequestResponseGet() {
if (this.responseType === 'arraybuffer') { if (this.responseType === 'arraybuffer') {
return new Uint8Array(new VBArray(this.responseBody).toArray()); return new Uint8Array(new VBArray(this.responseBody).toArray());
} else {
return this.responseText;
} }
return this.responseText;
} }
}); });
return; return;

49
web/pdf_viewer.js

@ -347,8 +347,9 @@
b = q; b = q;
} }
} }
var result;
if (x_ - a / b < c / d - x_) { if (x_ - a / b < c / d - x_) {
return x_ === x ? [ result = x_ === x ? [
a, a,
b b
] : [ ] : [
@ -356,7 +357,7 @@
a a
]; ];
} else { } else {
return x_ === x ? [ result = x_ === x ? [
c, c,
d d
] : [ ] : [
@ -364,6 +365,7 @@
c c
]; ];
} }
return result;
} }
function roundToDivide(x, div) { function roundToDivide(x, div) {
var r = x % div; var r = x % div;
@ -989,17 +991,16 @@
offset.matchIdx = previous ? numMatches - 1 : 0; offset.matchIdx = previous ? numMatches - 1 : 0;
this.updateMatch(true); this.updateMatch(true);
return true; return true;
} else { }
this.advanceOffsetPage(previous); this.advanceOffsetPage(previous);
if (offset.wrapped) { if (offset.wrapped) {
offset.matchIdx = null; offset.matchIdx = null;
if (this.pagesToSearch < 0) { if (this.pagesToSearch < 0) {
this.updateMatch(false); this.updateMatch(false);
return true; return true;
}
} }
return false;
} }
return false;
}, },
updateMatchPosition: function PDFFindController_updateMatchPosition(pageIndex, index, elements, beginIdx) { updateMatchPosition: function PDFFindController_updateMatchPosition(pageIndex, index, elements, beginIdx) {
if (this.selected.matchIdx === index && this.selected.pageIdx === pageIndex) { if (this.selected.matchIdx === index && this.selected.pageIdx === pageIndex) {
@ -1237,9 +1238,8 @@
this.nextHashParam = null; this.nextHashParam = null;
this.updatePreviousBookmark = true; this.updatePreviousBookmark = true;
return; return;
} else {
this.nextHashParam = null;
} }
this.nextHashParam = null;
} }
if (params.hash) { if (params.hash) {
if (this.current.hash) { if (this.current.hash) {
@ -3104,19 +3104,18 @@
_getVisiblePages: function () { _getVisiblePages: function () {
if (!this.isInPresentationMode) { if (!this.isInPresentationMode) {
return getVisibleElements(this.container, this._pages, true); return getVisibleElements(this.container, this._pages, true);
} else {
var visible = [];
var currentPage = this._pages[this._currentPageNumber - 1];
visible.push({
id: currentPage.id,
view: currentPage
});
return {
first: currentPage,
last: currentPage,
views: visible
};
} }
var visible = [];
var currentPage = this._pages[this._currentPageNumber - 1];
visible.push({
id: currentPage.id,
view: currentPage
});
return {
first: currentPage,
last: currentPage,
views: visible
};
}, },
cleanup: function () { cleanup: function () {
for (var i = 0, ii = this._pages.length; i < ii; i++) { for (var i = 0, ii = this._pages.length; i < ii; i++) {

Loading…
Cancel
Save