Enable loading of PDFs with undefined or missing stream lengths

This commit is contained in:
Jonas 2013-08-16 16:32:40 +02:00
parent abe00cbc76
commit 628f4aaf81
3 changed files with 15 additions and 2 deletions

View File

@ -208,8 +208,10 @@ var Parser = (function ParserClosure() {
// get length
var length = this.fetchIfRef(dict.get('Length'));
if (!isInt(length))
error('Bad ' + length + ' attribute in stream');
if (!isInt(length)) {
info('Bad ' + length + ' attribute in stream');
length = 0;
}
// skip over the stream data
stream.pos = pos + length;

View File

@ -0,0 +1 @@
http://dl.dropbox.com/u/22242495/pdfjs/pdfkit_uncompressed.pdf

View File

@ -23,6 +23,16 @@
"rounds": 1,
"type": "text"
},
{ "id": "issue1293",
"file": "pdfs/issue1293.pdf",
"md5": "0a744b3bbf2fd8da0131fd3c01dd1e30",
"rounds": 1,
"link": true,
"firstPage": 1,
"lastPage": 1,
"type": "load",
"about": "PDF with undefined stream length."
},
{ "id": "issue2881",
"file": "pdfs/issue2881.pdf",
"md5": "ea6ade27d2cb146676d23dcd6605d5ee",