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
I am using selenium and Ghost to capture screenshots as
pdf. The code for saving screenshot isNow 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
It gives error
PdfReadError: EOF marker not found. The reason i am trying to open this file usingPdfFileReaderis 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