Merge pull request #1899 from benbro/master
Catch errors when parsing the localization header.
This commit is contained in:
commit
9c012f8a4d
11
src/core.js
11
src/core.js
@ -399,9 +399,14 @@ var PDFDocument = (function PDFDocumentClosure() {
|
||||
var length = this.stream.length;
|
||||
var linearization = false;
|
||||
if (length) {
|
||||
linearization = new Linearization(this.stream);
|
||||
if (linearization.length != length)
|
||||
linearization = false;
|
||||
try {
|
||||
linearization = new Linearization(this.stream);
|
||||
if (linearization.length != length)
|
||||
linearization = false;
|
||||
} catch (err) {
|
||||
warn('The linearization data is not available ' +
|
||||
'or unreadable pdf data is found');
|
||||
}
|
||||
}
|
||||
// shadow the prototype getter with a data property
|
||||
return shadow(this, 'linearization', linearization);
|
||||
|
Loading…
x
Reference in New Issue
Block a user