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) {
|
readXRef: function readXref(startXRef) {
|
||||||
var stream = this.stream;
|
var stream = this.stream;
|
||||||
stream.pos = startXRef;
|
stream.pos = startXRef;
|
||||||
|
try {
|
||||||
var parser = new Parser(new Lexer(stream), true);
|
var parser = new Parser(new Lexer(stream), true);
|
||||||
var obj = parser.getObj();
|
var obj = parser.getObj();
|
||||||
// parse an old-style xref table
|
// parse an old-style xref table
|
||||||
@ -532,6 +533,10 @@ var XRef = (function xRefXRef() {
|
|||||||
}
|
}
|
||||||
return this.readXRefStream(obj);
|
return this.readXRefStream(obj);
|
||||||
}
|
}
|
||||||
|
} catch(e) {
|
||||||
|
log('Reading of the xref table/stream failed: ' + e);
|
||||||
|
}
|
||||||
|
warn('Indexing all PDF objects');
|
||||||
return this.indexObjects();
|
return this.indexObjects();
|
||||||
},
|
},
|
||||||
getEntry: function xRefGetEntry(i) {
|
getEntry: function xRefGetEntry(i) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user