Merge pull request #489 from notmasteryet/tree-18

Modifying how the artofwar encryption handled
This commit is contained in:
Andreas Gal 2011-09-17 09:04:49 -07:00
commit fe01091053
3 changed files with 16 additions and 2 deletions

11
pdf.js
View File

@ -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');

View File

@ -0,0 +1 @@
http://www.airgid.com/book/wdsg_fitc.pdf

View File

@ -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"
} }
] ]