uber1geek / PDF-Encrypt

Encrypts a directory containing PDF files with 128 bit AES.
MIT License
0 stars 1 forks source link

Issue with Scanned PDFs #1

Open uber1geek opened 7 years ago

uber1geek commented 7 years ago

I get this error for some pdf files, i guess this happens because some pdf's have the contents as an image (scanned pdf).

Traceback (most recent call last): File "pdfencrypt.py", line 47, in main() File "pdfencrypt.py", line 44, in main set_password(file, args.user_password, args.owner_password) File "pdfencrypt.py", line 20, in set_password for i in range(0, input_file.getNumPages()): File "/Library/Python/2.7/site-packages/PyPDF2/pdf.py", line 1155, in getNumPages self.flatten() File "/Library/Python/2.7/site-packages/PyPDF2/pdf.py", line 1505, in flatten catalog = self.trailer["/Root"].getObject() File "/Library/Python/2.7/site-packages/PyPDF2/generic.py", line 516, in __getitem return dict.getitem(self, key).getObject() File "/Library/Python/2.7/site-packages/PyPDF2/generic.py", line 178, in getObject return self.pdf.getObject(self).getObject() File "/Library/Python/2.7/site-packages/PyPDF2/pdf.py", line 1604, in getObject % (indirectReference.idnum, indirectReference.generation, idnum, generation)) PyPDF2.utils.PdfReadError: Expected object ID (5 0) does not match actual (4 0); xref table not zero-indexed.

Ikmel commented 7 years ago

I have the same issue!!!