python - pyPDF IOError Exception in OSX -
i trying open pdf (named kalimera.pdf) using pdffilereader pypdf module, using following set of commands
from pypdf import pdffilereader, pdffilewriter document = pdffilereader(open('kalimera.pdf', 'rb')) i following error:
traceback (most recent call last): file "<stdin>", line 1, in <module> file "/library/python/2.7/site-packages/pypdf/pdf.py", line 374, in __init__ self.read(stream) file "/library/python/2.7/site-packages/pypdf/pdf.py", line 702, in read stream.seek(-1, 2) ioerror: [errno 22] invalid argument the platform osx 10.11.3 , python version 2.7.10 (although reproduced in python3.5 well).
i don't know why getting error , reading pdf file in binary mode , passing pdffilereader, maybe should try other pdf files.
anyway, try use : https://pythonhosted.org/pypdf2/ latest version of pypdf, , think supports python2.7.
Comments
Post a Comment