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 length = this.stream.length;
|
||||||
var linearization = false;
|
var linearization = false;
|
||||||
if (length) {
|
if (length) {
|
||||||
linearization = new Linearization(this.stream);
|
try {
|
||||||
if (linearization.length != length)
|
linearization = new Linearization(this.stream);
|
||||||
linearization = false;
|
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
|
// shadow the prototype getter with a data property
|
||||||
return shadow(this, 'linearization', linearization);
|
return shadow(this, 'linearization', linearization);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user