Disable encryption when a ToUnicode stream is used in a font
This commit is contained in:
		
							parent
							
								
									3ea4e25fb3
								
							
						
					
					
						commit
						94da20d776
					
				
							
								
								
									
										9
									
								
								pdf.js
									
									
									
									
									
								
							
							
						
						
									
										9
									
								
								pdf.js
									
									
									
									
									
								
							@ -3185,7 +3185,7 @@ var XRef = (function() {
 | 
			
		||||
        return obj;
 | 
			
		||||
      return this.fetch(obj);
 | 
			
		||||
    },
 | 
			
		||||
    fetch: function(ref) {
 | 
			
		||||
    fetch: function(ref, suppressEncryption) {
 | 
			
		||||
      var num = ref.num;
 | 
			
		||||
      var e = this.cache[num];
 | 
			
		||||
      if (e)
 | 
			
		||||
@ -3216,7 +3216,7 @@ var XRef = (function() {
 | 
			
		||||
          }
 | 
			
		||||
          error('bad XRef entry');
 | 
			
		||||
        }
 | 
			
		||||
        if (this.encrypt) {
 | 
			
		||||
        if (this.encrypt && !suppressEncryption) {
 | 
			
		||||
          e = parser.getObj(this.encrypt.createCipherTransform(num, gen));
 | 
			
		||||
        } else {
 | 
			
		||||
          e = parser.getObj();
 | 
			
		||||
@ -4356,7 +4356,10 @@ var PartialEvaluator = (function() {
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      if (type == 'TrueType' && dict.has('ToUnicode') && differences) {
 | 
			
		||||
        var cmapObj = xref.fetchIfRef(dict.get('ToUnicode'));
 | 
			
		||||
        var cmapObj = dict.get('ToUnicode');
 | 
			
		||||
        if (IsRef(cmapObj)) {
 | 
			
		||||
          cmapObj = xref.fetch(cmapObj, true);
 | 
			
		||||
        }
 | 
			
		||||
        if (IsName(cmapObj)) {
 | 
			
		||||
          error('ToUnicode file cmap translation not implemented');
 | 
			
		||||
        } else if (IsStream(cmapObj)) {
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										1
									
								
								test/pdfs/artofwar.pdf.link
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								test/pdfs/artofwar.pdf.link
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1 @@
 | 
			
		||||
http://www.puppetpress.com/classics/ArtofWarbySunTzu.pdf
 | 
			
		||||
@ -109,5 +109,11 @@
 | 
			
		||||
       "link": true,
 | 
			
		||||
       "rounds": 1,
 | 
			
		||||
       "type": "eq"
 | 
			
		||||
    },
 | 
			
		||||
    {  "id": "artofwar",
 | 
			
		||||
       "file": "pdfs/artofwar.pdf",
 | 
			
		||||
       "link": true,
 | 
			
		||||
       "rounds": 1,
 | 
			
		||||
       "type": "eq"
 | 
			
		||||
    }
 | 
			
		||||
]
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user