You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I tried to get the total pages of "test.pdf" using PdfReader, it said 2 pages, but that pdf file actually has 19 pages.
So I tried again with PdfFileReader from PyPDF2, it worked fine.
I don't know why PdfReader doesn't work properly, but I'm trying to use preexisting stream while initializing PdfReader as mentioned in the source code.
But it also failed because both PdfFileReader classes in pyPdf and pyPDF2 need stream argument as below.
>>>pdf_reader2=PdfReader(pdf_file_reader)
Traceback (mostrecentcalllast):
File"<stdin>", line1, in<module>File"/data/pdf_test/venv/lib/python3.7/site-packages/pdfrw/pdfreader.py", line565, in__init__fdata=fname.read()
TypeError: read() missing1requiredpositionalargument: 'stream'# pyPdfdefread(self, stream):
# start at the end:stream.seek(-1, 2)
# pyPDF2 defread(self, stream):
debug=Falseifdebug: print(">>read", stream)
# start at the end:
Could you update your source code to work properly with those streams?
Also, I'm adding that "test.pdf" for you to examine what's wrong with the page number.
When I tried to get the total pages of "test.pdf" using PdfReader, it said 2 pages, but that pdf file actually has 19 pages.
So I tried again with PdfFileReader from PyPDF2, it worked fine.
I don't know why PdfReader doesn't work properly, but I'm trying to use preexisting stream while initializing PdfReader as mentioned in the source code.
But it also failed because both PdfFileReader classes in pyPdf and pyPDF2 need stream argument as below.
Could you update your source code to work properly with those streams?
Also, I'm adding that "test.pdf" for you to examine what's wrong with the page number.
test.pdf
The text was updated successfully, but these errors were encountered: