Skip to content

Commit 646fd16

Browse files
committed
Merge pull request py-pdf#197 from elena/master
Fix "file has not been decrypted" error py-pdf#51.
2 parents af7dc5f + 15bd71b commit 646fd16

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

PyPDF2/pdf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -973,6 +973,7 @@ def getNumPages(self):
973973
if self.isEncrypted:
974974
try:
975975
self._override_encryption = True
976+
self.decrypt('')
976977
return self.trailer["/Root"]["/Pages"]["/Count"]
977978
except:
978979
raise utils.PdfReadError("File has not been decrypted")

0 commit comments

Comments
 (0)