Open arshad01 opened 5 years ago
I have done a fix for this issue. Please check if it is correct. Thanks.
Note: I could not run the unit tests successfully even without this change.
$ git diff
diff --git a/pdfrw/pdfreader.py b/pdfrw/pdfreader.py
index c2ae030..621fff4 100644
--- a/pdfrw/pdfreader.py
+++ b/pdfrw/pdfreader.py
@@ -614,8 +614,8 @@ class PdfReader(PdfDict):
# Find all the xref tables/streams, and
# then deal with them backwards.
xref_list = []
+ source.obj_offsets = {}
while 1:
- source.obj_offsets = {}
trailer, is_stream = self.parsexref(source)
prev = trailer.Prev
if prev is None:
Hello
I am using pdfrw to read an encrypted file. The file does not need a password to open it and I can view it in Adobe Reader. When opening with PdfReader I am getting an exception.
It seems like that the issue is being cause by not being able to find the object (197, 0) even though it is present in the pdf file. Object (197, 0) contains the details of the encryption.
Any help in solving this issue is greatly appreciated. Thanks
(Edit: Sample pdf can be downloaded from https://www.proofpoint.com/us/resources/white-papers/who-moved-my-data)