Browse Source

PDF.js version 1.0.499

master v1.0.499
Yury Delendik 11 years ago
parent
commit
1d69d95e9e
  1. 2
      bower.json
  2. 123
      build/pdf.combined.js
  3. 4
      build/pdf.js
  4. 123
      build/pdf.worker.js
  5. 2
      package.json

2
bower.json

@ -1,6 +1,6 @@
{ {
"name": "pdfjs-dist", "name": "pdfjs-dist",
"version": "1.0.497", "version": "1.0.499",
"keywords": [ "keywords": [
"Mozilla", "Mozilla",
"pdf", "pdf",

123
build/pdf.combined.js

@ -21,8 +21,8 @@ if (typeof PDFJS === 'undefined') {
(typeof window !== 'undefined' ? window : this).PDFJS = {}; (typeof window !== 'undefined' ? window : this).PDFJS = {};
} }
PDFJS.version = '1.0.497'; PDFJS.version = '1.0.499';
PDFJS.build = '1e52c77'; PDFJS.build = '2e47b58';
(function pdfjsWrapper() { (function pdfjsWrapper() {
// Use strict in our context only - users might not want it // Use strict in our context only - users might not want it
@ -7726,22 +7726,15 @@ var PDFDocument = (function PDFDocumentClosure() {
}, },
get linearization() { get linearization() {
var length = this.stream.length; var linearization = null;
var linearization = false; if (this.stream.length) {
if (length) {
try { try {
linearization = new Linearization(this.stream); linearization = Linearization.create(this.stream);
if (linearization.length != length) {
linearization = false;
}
} catch (err) { } catch (err) {
if (err instanceof MissingDataException) { if (err instanceof MissingDataException) {
throw err; throw err;
} }
info(err);
info('The linearization data is not available ' +
'or unreadable PDF data is found');
linearization = false;
} }
} }
// shadow the prototype getter with a data property // shadow the prototype getter with a data property
@ -34197,78 +34190,54 @@ var Lexer = (function LexerClosure() {
return Lexer; return Lexer;
})(); })();
var Linearization = (function LinearizationClosure() { var Linearization = {
function Linearization(stream) { create: function LinearizationCreate(stream) {
this.parser = new Parser(new Lexer(stream), false, null); function getInt(name, allowZeroValue) {
var obj1 = this.parser.getObj(); var obj = linDict.get(name);
var obj2 = this.parser.getObj(); if (isInt(obj) && (allowZeroValue ? obj >= 0 : obj > 0)) {
var obj3 = this.parser.getObj(); return obj;
this.linDict = this.parser.getObj();
if (isInt(obj1) && isInt(obj2) && isCmd(obj3, 'obj') &&
isDict(this.linDict)) {
var obj = this.linDict.get('Linearized');
if (!(isNum(obj) && obj > 0)) {
this.linDict = null;
} }
throw new Error('The "' + name + '" parameter in the linearization ' +
'dictionary is invalid.');
} }
function getHints() {
var hints = linDict.get('H'), hintsLength, item;
if (isArray(hints) &&
((hintsLength = hints.length) === 2 || hintsLength === 4)) {
for (var index = 0; index < hintsLength; index++) {
if (!(isInt(item = hints[index]) && item > 0)) {
throw new Error('Hint (' + index +
') in the linearization dictionary is invalid.');
} }
Linearization.prototype = {
getInt: function Linearization_getInt(name) {
var linDict = this.linDict;
var obj;
if (isDict(linDict) && isInt(obj = linDict.get(name)) && obj > 0) {
return obj;
} }
error('"' + name + '" field in linearization table is invalid'); return hints;
},
getHint: function Linearization_getHint(index) {
var linDict = this.linDict;
var obj1, obj2;
if (isDict(linDict) && isArray(obj1 = linDict.get('H')) &&
obj1.length >= 2 && isInt(obj2 = obj1[index]) && obj2 > 0) {
return obj2;
} }
error('Hints table in linearization table is invalid: ' + index); throw new Error('Hint array in the linearization dictionary is invalid.');
},
get length() {
if (!isDict(this.linDict)) {
return 0;
} }
return this.getInt('L'); var parser = new Parser(new Lexer(stream), false, null);
}, var obj1 = parser.getObj();
get hintsOffset() { var obj2 = parser.getObj();
return this.getHint(0); var obj3 = parser.getObj();
}, var linDict = parser.getObj();
get hintsLength() { var obj, length;
return this.getHint(1); if (!(isInt(obj1) && isInt(obj2) && isCmd(obj3, 'obj') && isDict(linDict) &&
}, isNum(obj = linDict.get('Linearized')) && obj > 0)) {
get hintsOffset2() { return null; // No valid linearization dictionary found.
return this.getHint(2); } else if ((length = getInt('L')) !== stream.length) {
}, throw new Error('The "L" parameter in the linearization dictionary ' +
get hintsLenth2() { 'does not equal the stream length.');
return this.getHint(3); }
}, return {
get objectNumberFirst() { length: length,
return this.getInt('O'); hints: getHints(),
}, objectNumberFirst: getInt('O'),
get endFirst() { endFirst: getInt('E'),
return this.getInt('E'); numPages: getInt('N'),
}, mainXRefEntriesOffset: getInt('T'),
get numPages() { pageFirst: (linDict.has('P') ? getInt('P', true) : 0)
return this.getInt('N'); };
},
get mainXRefEntriesOffset() {
return this.getInt('T');
},
get pageFirst() {
return this.getInt('P');
} }
}; };
return Linearization;
})();
var PostScriptParser = (function PostScriptParserClosure() { var PostScriptParser = (function PostScriptParserClosure() {

4
build/pdf.js

@ -21,8 +21,8 @@ if (typeof PDFJS === 'undefined') {
(typeof window !== 'undefined' ? window : this).PDFJS = {}; (typeof window !== 'undefined' ? window : this).PDFJS = {};
} }
PDFJS.version = '1.0.497'; PDFJS.version = '1.0.499';
PDFJS.build = '1e52c77'; PDFJS.build = '2e47b58';
(function pdfjsWrapper() { (function pdfjsWrapper() {
// Use strict in our context only - users might not want it // Use strict in our context only - users might not want it

123
build/pdf.worker.js vendored

@ -21,8 +21,8 @@ if (typeof PDFJS === 'undefined') {
(typeof window !== 'undefined' ? window : this).PDFJS = {}; (typeof window !== 'undefined' ? window : this).PDFJS = {};
} }
PDFJS.version = '1.0.497'; PDFJS.version = '1.0.499';
PDFJS.build = '1e52c77'; PDFJS.build = '2e47b58';
(function pdfjsWrapper() { (function pdfjsWrapper() {
// Use strict in our context only - users might not want it // Use strict in our context only - users might not want it
@ -2867,22 +2867,15 @@ var PDFDocument = (function PDFDocumentClosure() {
}, },
get linearization() { get linearization() {
var length = this.stream.length; var linearization = null;
var linearization = false; if (this.stream.length) {
if (length) {
try { try {
linearization = new Linearization(this.stream); linearization = Linearization.create(this.stream);
if (linearization.length != length) {
linearization = false;
}
} catch (err) { } catch (err) {
if (err instanceof MissingDataException) { if (err instanceof MissingDataException) {
throw err; throw err;
} }
info(err);
info('The linearization data is not available ' +
'or unreadable PDF data is found');
linearization = false;
} }
} }
// shadow the prototype getter with a data property // shadow the prototype getter with a data property
@ -29338,78 +29331,54 @@ var Lexer = (function LexerClosure() {
return Lexer; return Lexer;
})(); })();
var Linearization = (function LinearizationClosure() { var Linearization = {
function Linearization(stream) { create: function LinearizationCreate(stream) {
this.parser = new Parser(new Lexer(stream), false, null); function getInt(name, allowZeroValue) {
var obj1 = this.parser.getObj(); var obj = linDict.get(name);
var obj2 = this.parser.getObj(); if (isInt(obj) && (allowZeroValue ? obj >= 0 : obj > 0)) {
var obj3 = this.parser.getObj(); return obj;
this.linDict = this.parser.getObj();
if (isInt(obj1) && isInt(obj2) && isCmd(obj3, 'obj') &&
isDict(this.linDict)) {
var obj = this.linDict.get('Linearized');
if (!(isNum(obj) && obj > 0)) {
this.linDict = null;
} }
throw new Error('The "' + name + '" parameter in the linearization ' +
'dictionary is invalid.');
} }
function getHints() {
var hints = linDict.get('H'), hintsLength, item;
if (isArray(hints) &&
((hintsLength = hints.length) === 2 || hintsLength === 4)) {
for (var index = 0; index < hintsLength; index++) {
if (!(isInt(item = hints[index]) && item > 0)) {
throw new Error('Hint (' + index +
') in the linearization dictionary is invalid.');
} }
Linearization.prototype = {
getInt: function Linearization_getInt(name) {
var linDict = this.linDict;
var obj;
if (isDict(linDict) && isInt(obj = linDict.get(name)) && obj > 0) {
return obj;
} }
error('"' + name + '" field in linearization table is invalid'); return hints;
},
getHint: function Linearization_getHint(index) {
var linDict = this.linDict;
var obj1, obj2;
if (isDict(linDict) && isArray(obj1 = linDict.get('H')) &&
obj1.length >= 2 && isInt(obj2 = obj1[index]) && obj2 > 0) {
return obj2;
} }
error('Hints table in linearization table is invalid: ' + index); throw new Error('Hint array in the linearization dictionary is invalid.');
},
get length() {
if (!isDict(this.linDict)) {
return 0;
} }
return this.getInt('L'); var parser = new Parser(new Lexer(stream), false, null);
}, var obj1 = parser.getObj();
get hintsOffset() { var obj2 = parser.getObj();
return this.getHint(0); var obj3 = parser.getObj();
}, var linDict = parser.getObj();
get hintsLength() { var obj, length;
return this.getHint(1); if (!(isInt(obj1) && isInt(obj2) && isCmd(obj3, 'obj') && isDict(linDict) &&
}, isNum(obj = linDict.get('Linearized')) && obj > 0)) {
get hintsOffset2() { return null; // No valid linearization dictionary found.
return this.getHint(2); } else if ((length = getInt('L')) !== stream.length) {
}, throw new Error('The "L" parameter in the linearization dictionary ' +
get hintsLenth2() { 'does not equal the stream length.');
return this.getHint(3); }
}, return {
get objectNumberFirst() { length: length,
return this.getInt('O'); hints: getHints(),
}, objectNumberFirst: getInt('O'),
get endFirst() { endFirst: getInt('E'),
return this.getInt('E'); numPages: getInt('N'),
}, mainXRefEntriesOffset: getInt('T'),
get numPages() { pageFirst: (linDict.has('P') ? getInt('P', true) : 0)
return this.getInt('N'); };
},
get mainXRefEntriesOffset() {
return this.getInt('T');
},
get pageFirst() {
return this.getInt('P');
} }
}; };
return Linearization;
})();
var PostScriptParser = (function PostScriptParserClosure() { var PostScriptParser = (function PostScriptParserClosure() {

2
package.json

@ -1,6 +1,6 @@
{ {
"name": "pdfjs-dist", "name": "pdfjs-dist",
"version": "1.0.497", "version": "1.0.499",
"description": "Generic build of Mozilla's PDF.js library.", "description": "Generic build of Mozilla's PDF.js library.",
"keywords": [ "keywords": [
"Mozilla", "Mozilla",

Loading…
Cancel
Save