PyPDF2 throws TypeError - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

PyPDF2 throws TypeError

SreenathSreenath IndiaPosts: 0Member

I am trying to create watermark on a pdf file. Am using py3.4 and PyPDF2. while executing the merge statement i am getting error as shown below. Any help would be greatly appreciated.

Traceback (most recent call last): File "C:\Documents and Settings\Administrator.COMPUTER-D2BC9B\Desktop\", line 49, in page1.mergePage(page3) File "c:\python34\lib\site-packages\PyPDF2\", line 1803, in mergePage self.mergePage(page2) File "c:\python34\lib\site-packages\PyPDF2\", line 1853, in _mergePage originalContent, self.pdf)) File "c:\python34\lib\site-packages\PyPDF2\", line 1766, in _pushPopGS stream = ContentStream(contents, pdf) File "c:\python34\lib\site-packages\PyPDF2\", line 2210, in init stream = BytesIO(b(stream.getData())) File "c:\python34\lib\site-packages\PyPDF2\", line 829, in getData decoded._data = filters.decodeStreamData(self) File "c:\python34\lib\site-packages\PyPDF2\", line 316, in decodeStreamData data = ASCII85Decode.decode(data) File "c:\python34\lib\site-packages\PyPDF2\", line 256, in decode data = [y for y in data if not (y in ' \n\r\t')] File "c:\python34\lib\site-packages\PyPDF2\", line 256, in data = [y for y in data if not (y in ' \n\r\t')] TypeError: 'in ' requires string as left operand, not int

Sign In or Register to comment.