Enable loading of PDFs with undefined or missing stream lengths
This commit is contained in:
		
							parent
							
								
									abe00cbc76
								
							
						
					
					
						commit
						628f4aaf81
					
				| @ -208,8 +208,10 @@ var Parser = (function ParserClosure() { | |||||||
| 
 | 
 | ||||||
|       // get length
 |       // get length
 | ||||||
|       var length = this.fetchIfRef(dict.get('Length')); |       var length = this.fetchIfRef(dict.get('Length')); | ||||||
|       if (!isInt(length)) |       if (!isInt(length)) { | ||||||
|         error('Bad ' + length + ' attribute in stream'); |         info('Bad ' + length + ' attribute in stream'); | ||||||
|  |         length = 0; | ||||||
|  |       } | ||||||
| 
 | 
 | ||||||
|       // skip over the stream data
 |       // skip over the stream data
 | ||||||
|       stream.pos = pos + length; |       stream.pos = pos + length; | ||||||
|  | |||||||
							
								
								
									
										1
									
								
								test/pdfs/issue1293.pdf.link
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								test/pdfs/issue1293.pdf.link
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1 @@ | |||||||
|  | http://dl.dropbox.com/u/22242495/pdfjs/pdfkit_uncompressed.pdf | ||||||
| @ -23,6 +23,16 @@ | |||||||
|        "rounds": 1, |        "rounds": 1, | ||||||
|        "type": "text" |        "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", |     {  "id": "issue2881", | ||||||
|        "file": "pdfs/issue2881.pdf", |        "file": "pdfs/issue2881.pdf", | ||||||
|        "md5": "ea6ade27d2cb146676d23dcd6605d5ee", |        "md5": "ea6ade27d2cb146676d23dcd6605d5ee", | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user