Open neofyte opened 11 years ago
I am porting my script from python27 to python33. When I run the code pdf = PdfFileReader(open('xxxx.pdf', 'rb')), the error message appears:
pdf = PdfFileReader(open('xxxx.pdf', 'rb'))
Traceback (most recent call last): File ..., in <module>raw_content = pdf.getPage(0).extractText() File "C:\Python33\lib\site-packages\PyPDF2\pdf.py", line 1718, in extract Textcontent = ContentStream(content, self.pdf) File "C:\Python33\lib\site-packages\PyPDF2\pdf.py", line 1797, in __init__data += s.getObject().getData() TypeError: Can't convert 'bytes' object to str implicitly
On the other hand, I cannot open the file with
pdf = PdfFileReader(open('xxxx.pdf', 'r'))
otherwise, it comes the following messages:
io.UnsupportedOperation: can't do nonzero end-relative seeks
What's going wrong?
I am having the same problem :( Have you found any solution?
Same problem :(
According to docs you can't seek the end of a file without the beginning for python 3.2+. I am having the same issue.
same problem
I am porting my script from python27 to python33. When I run the code
pdf = PdfFileReader(open('xxxx.pdf', 'rb'))
, the error message appears:On the other hand, I cannot open the file with
otherwise, it comes the following messages:
What's going wrong?