Skip to content

PdfReadError: EOF marker not found error when opening pdf files generated from selenium snapshot #177

@lovesh

Description

@lovesh

I am using selenium and Ghost to capture screenshots as pdf. The code for saving screenshot is

driver.get('http://localhost/report/10?page=1')
driver.save_screenshot('page1.pdf')

Now i can open these files in a pdf viewer(I am using Okular) and they look fine. But when i try to open them using this code

from PyPDF2 import PdfFileReader
input1 = PdfFileReader(open("page1.pdf", "rb"))

It gives error PdfReadError: EOF marker not found. The reason i am trying to open this file using PdfFileReader is that i need to merge several pdfs into one and for that i need to open these pdfs. I found a github issue #34 and it says it was resolved but i still face this issue. My pypdf version is 1.24

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-bugFrom a users perspective, this is a bug - a violation of the expected behavior with a compliant PDF

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions