Merge pull request #489 from notmasteryet/tree-18
Modifying how the artofwar encryption handled
This commit is contained in:
		
						commit
						fe01091053
					
				
							
								
								
									
										11
									
								
								pdf.js
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								pdf.js
									
									
									
									
									
								
							@ -3224,7 +3224,14 @@ var XRef = (function() {
 | 
				
			|||||||
          error('bad XRef entry');
 | 
					          error('bad XRef entry');
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        if (this.encrypt && !suppressEncryption) {
 | 
					        if (this.encrypt && !suppressEncryption) {
 | 
				
			||||||
          e = parser.getObj(this.encrypt.createCipherTransform(num, gen));
 | 
					          try {
 | 
				
			||||||
 | 
					            e = parser.getObj(this.encrypt.createCipherTransform(num, gen));
 | 
				
			||||||
 | 
					          } catch(ex) {
 | 
				
			||||||
 | 
					            // almost all streams must to encrypted, but sometimes
 | 
				
			||||||
 | 
					            // they are not probably due to some broken generators
 | 
				
			||||||
 | 
					            // re-trying without encryption
 | 
				
			||||||
 | 
					            return this.fetch(ref, true);
 | 
				
			||||||
 | 
					          }
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
          e = parser.getObj();
 | 
					          e = parser.getObj();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@ -4381,7 +4388,7 @@ var PartialEvaluator = (function() {
 | 
				
			|||||||
      if (type == 'TrueType' && dict.has('ToUnicode') && differences) {
 | 
					      if (type == 'TrueType' && dict.has('ToUnicode') && differences) {
 | 
				
			||||||
        var cmapObj = dict.get('ToUnicode');
 | 
					        var cmapObj = dict.get('ToUnicode');
 | 
				
			||||||
        if (IsRef(cmapObj)) {
 | 
					        if (IsRef(cmapObj)) {
 | 
				
			||||||
          cmapObj = xref.fetch(cmapObj, true);
 | 
					          cmapObj = xref.fetch(cmapObj);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        if (IsName(cmapObj)) {
 | 
					        if (IsName(cmapObj)) {
 | 
				
			||||||
          error('ToUnicode file cmap translation not implemented');
 | 
					          error('ToUnicode file cmap translation not implemented');
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										1
									
								
								test/pdfs/wdsg_fitc.pdf.link
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								test/pdfs/wdsg_fitc.pdf.link
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1 @@
 | 
				
			|||||||
 | 
					http://www.airgid.com/book/wdsg_fitc.pdf
 | 
				
			||||||
@ -115,5 +115,11 @@
 | 
				
			|||||||
       "link": true,
 | 
					       "link": true,
 | 
				
			||||||
       "rounds": 1,
 | 
					       "rounds": 1,
 | 
				
			||||||
       "type": "eq"
 | 
					       "type": "eq"
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    {  "id": "wdsg_fitc",
 | 
				
			||||||
 | 
					       "file": "pdfs/wdsg_fitc.pdf",
 | 
				
			||||||
 | 
					       "link": true,
 | 
				
			||||||
 | 
					       "rounds": 1,
 | 
				
			||||||
 | 
					       "type": "eq"
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
]
 | 
					]
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user