1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Support corrupted pdfs that are encrypted but lack 'ID' in trailer

This commit is contained in:
mduan 2013-01-08 19:00:05 -08:00
parent 2ccad4ca45
commit 48fa0172ed

View file

@ -342,8 +342,9 @@ var XRef = (function XRefClosure() {
var encrypt = trailerDict.get('Encrypt');
if (encrypt) {
var fileId = trailerDict.get('ID');
this.encrypt = new CipherTransformFactory(encrypt, fileId[0], password);
var ids = trailerDict.get('ID');
var fileId = (ids && ids.length) ? ids[0] : '';
this.encrypt = new CipherTransformFactory(encrypt, fileId, password);
}
// get the root dictionary (catalog) object