1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-25 17:48:07 +02:00

Re-factor parsing of the Linearization dictionary

This commit is contained in:
Jonas Jenwald 2014-07-02 12:48:09 +02:00
parent 1e52c770d9
commit a5c98aab36
2 changed files with 49 additions and 80 deletions

View file

@ -358,22 +358,15 @@ var PDFDocument = (function PDFDocumentClosure() {
},
get linearization() {
var length = this.stream.length;
var linearization = false;
if (length) {
var linearization = null;
if (this.stream.length) {
try {
linearization = new Linearization(this.stream);
if (linearization.length != length) {
linearization = false;
}
linearization = Linearization.create(this.stream);
} catch (err) {
if (err instanceof MissingDataException) {
throw err;
}
info('The linearization data is not available ' +
'or unreadable PDF data is found');
linearization = false;
info(err);
}
}
// shadow the prototype getter with a data property