invalid pdf header: b'{"typ'
EOF marker not found
Traceback (most recent call last):
File "D: xxxx\main.py", line 43, in <module>
pdfDownload(book_data, user.book_id, user_agent)
File "D:xxx\download.py", line 58, in pdfDownload
pdf_reader = PdfReader(temp_pdf_file)
File "D:\Python\Python39\lib\site-packages\pypdf\_reader.py", line 332, in __init__
self.read(stream)
File "D:\Python\Python39\lib\site-packages\pypdf\_reader.py", line 1554, in read
self._find_eof_marker(stream)
File "D:\Python\Python39\lib\site-packages\pypdf\_reader.py", line 1625, in _find_eof_marker
line = read_previous_line(stream)
File "D:\Python\Python39\lib\site-packages\pypdf\_utils.py", line 268, in read_previous_line
raise PdfStreamError(STREAM_TRUNCATED_PREMATURELY)
pypdf.errors.PdfStreamError: Stream has ended unexpectedly