-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
Has MCVEA minimal, complete and verifiable example helps a lot to debug / understand feature requestsA minimal, complete and verifiable example helps a lot to debug / understand feature requestsis-robustness-issueFrom a users perspective, this is about robustnessFrom a users perspective, this is about robustness
Description
From this answer on StackOverflow the "minimal" PDF is
$ cat /tmp/minimal.pdf
%PDF-1.0
1 0 obj<</Type/Catalog/Pages 2 0 R>>endobj 2 0 obj<</Type/Pages/Kids[3 0 R]/Count 1>>endobj 3 0 obj<</Type/Page/MediaBox[0 0 3 3]>>endobj
trailer<</Size 4/Root 1 0 R>>
I can read /tmp/minimal.pdf with Evince and Chrome built-in PDF reader but PyPDF2 gives me
>>> import PyPDF2
>>> PyPDF2.__version__
'1.26.0'
>>> PyPDF2.PdfFileReader("/tmp/f.pdf")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/raniere/anaconda3/envs/fat/lib/python3.5/site-packages/PyPDF2/pdf.py", line 1084, in __init__
self.read(stream)
File "/home/raniere/anaconda3/envs/fat/lib/python3.5/site-packages/PyPDF2/pdf.py", line 1697, in read
line = self.readNextEndLine(stream)
File "/home/raniere/anaconda3/envs/fat/lib/python3.5/site-packages/PyPDF2/pdf.py", line 1937, in readNextEndLine
raise utils.PdfReadError("Could not read malformed PDF file")
PyPDF2.utils.PdfReadError: Could not read malformed PDF file
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Has MCVEA minimal, complete and verifiable example helps a lot to debug / understand feature requestsA minimal, complete and verifiable example helps a lot to debug / understand feature requestsis-robustness-issueFrom a users perspective, this is about robustnessFrom a users perspective, this is about robustness