If readXRefStream or readXRefTable fails, fallback to object indexing (#828)
This commit is contained in:
parent
c0291e9fa3
commit
0f7f80ee6e
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user