Open
Description
Environment
Which environment were you using when you encountered the problem?
$ python -m platform
Windows-11-10.0.26100-SP0
$ python -c "import pypdf;print(pypdf._debug_versions)"
pypdf==5.4.0, crypt_provider=('cryptography', '44.0.2'), PIL=10.4.0
Code + PDF
This is a minimal, complete example that shows the issue:
>>> theFile = r"C:\Users\tvrom\Documents\eqbPDFChartPlus.pdf"
>>> from pypdf import PdfReader
>>> reader = PdfReader(theFile)
Share here the PDF file(s) that cause the issue. The smaller they are, the
better. Let us know if we may add them to our tests!
Traceback
This is the complete traceback I see:
Traceback (most recent call last):
File "<interactive input>", line 1, in <module>
File "C:\Users\tvrom\AppData\Local\Programs\Python\Python312\Lib\site-packages\pypdf\_reader.py", line 136, in __init__
self._initialize_stream(stream)
File "C:\Users\tvrom\AppData\Local\Programs\Python\Python312\Lib\site-packages\pypdf\_reader.py", line 158, in _initialize_stream
self.read(stream)
File "C:\Users\tvrom\AppData\Local\Programs\Python\Python312\Lib\site-packages\pypdf\_reader.py", line 594, in read
startxref = self._find_startxref_pos(stream)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\tvrom\AppData\Local\Programs\Python\Python312\Lib\site-packages\pypdf\_reader.py", line 726, in _find_startxref_pos
raise PdfReadError("startxref not found")
pypdf.errors.PdfReadError: startxref not found