Skip to content

PdfReadError: Could not find xref table at specified location #1089

@MartinThoma

Description

@MartinThoma

I wanted to get metadata from a PDF. The PDF opens fine in Chrome.

Environment

Which environment were you using when you encountered the problem?

$ python -m platform
Linux-5.4.0-121-generic-x86_64-with-glibc2.31

$ python -c "import PyPDF2;print(PyPDF2.__version__)"
2.4.2

Code + PDF

The PDF: pdf/6f6d505d151b9769900a8bd315db6e67.pdf

>>> from PyPDF2 import PdfReader
>>> reader = PdfReader('pdf/6f6d505d151b9769900a8bd315db6e67.pdf')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/moose/Github/py-pdf/PyPDF2/PyPDF2/_reader.py", line 267, in __init__
    self.read(stream)
  File "/home/moose/Github/py-pdf/PyPDF2/PyPDF2/_reader.py", line 1305, in read
    raise PdfReadError("Could not find xref table at specified location")
PyPDF2.errors.PdfReadError: Could not find xref table at specified location

Metadata

Metadata

Assignees

No one assigned

    Labels

    Has MCVEA minimal, complete and verifiable example helps a lot to debug / understand feature requestsPdfReaderThe PdfReader component is affectedis-robustness-issueFrom a users perspective, this is about robustness

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions