If readXRefStream or readXRefTable fails, fallback to object indexing (#828)

This commit is contained in:
notmasteryet 2011-12-02 15:31:29 -06:00
parent c0291e9fa3
commit 0f7f80ee6e

View File

@ -518,6 +518,7 @@ var XRef = (function xRefXRef() {
readXRef: function readXref(startXRef) {
var stream = this.stream;
stream.pos = startXRef;
try {
var parser = new Parser(new Lexer(stream), true);
var obj = parser.getObj();
// parse an old-style xref table
@ -532,6 +533,10 @@ var XRef = (function xRefXRef() {
}
return this.readXRefStream(obj);
}
} catch(e) {
log('Reading of the xref table/stream failed: ' + e);
}
warn('Indexing all PDF objects');
return this.indexObjects();
},
getEntry: function xRefGetEntry(i) {