{"action":"opened","issue":{"url":"https://api.github.com/repos/pmaupin/pdfrw/issues/58","repository_url":"https://api.github.com/repos/pmaupin/pdfrw","labels_url":"https://api.github.com/repos/pmaupin/pdfrw/issues/58/labels{/name}","comments_url":"https://api.github.com/repos/pmaupin/pdfrw/issues/58/comments","events_url":"https://api.github.com/repos/pmaupin/pdfrw/issues/58/events","html_url":"https://github.com/pmaupin/pdfrw/issues/58","id":160191665,"number":58,"title":"Stopiteration exception","user":{"login":"tassamartz","id":4063358,"avatar_url":"https://avatars.githubusercontent.com/u/4063358?v=3","gravatar_id":"","url":"https://api.github.com/users/tassamartz","html_url":"https://github.com/tassamartz","followers_url":"https://api.github.com/users/tassamartz/followers","following_url":"https://api.github.com/users/tassamartz/following{/other_user}","gists_url":"https://api.github.com/users/tassamartz/gists{/gist_id}","starred_url":"https://api.github.com/users/tassamartz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tassamartz/subscriptions","organizations_url":"https://api.github.com/users/tassamartz/orgs","repos_url":"https://api.github.com/users/tassamartz/repos","events_url":"https://api.github.com/users/tassamartz/events{/privacy}","received_events_url":"https://api.github.com/users/tassamartz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-06-14T14:12:05Z","updated_at":"2016-06-14T14:12:05Z","closed_at":null,"body":"Hello there,\r\n\r\nFirst thanks for your great work!\r\n\r\nI've been using this library for a while and it worked perfectly, my use case is the following:\r\n 1- I build a pdf document with reportlab library\r\n 2- I have other existing pdf documents that i append at the end of the document build in 1-. Till now every thing was fine till i encountered an error with a pdf file which when i want to add it at the end of the document, the program  exits with an error on Stopiteration exception. Following is the error stack. The pdf document in question is fine when opened with adobe  Acrobat reader and is made of 3 pages.  So is there something i can do to know that some pdf file are not supported ?\r\n\r\nThanks!\r\n\r\nFile \"/usr/local/lib/python2.7/dist-packages/pdfrw/pdfwriter.py\", line 316, in write\r\n[Mon Jun 13 13:15:50.782466 2016] [:error] [pid 16822]     self.killobj, user_fmt=user_fmt)\r\n[Mon Jun 13 13:15:50.782471 2016] [:error] [pid 16822]   File \"/usr/local/lib/python2.7/dist-packages/pdfrw/pdfwriter.py\", line 196, in FormatObjects\r\n[Mon Jun 13 13:15:50.782476 2016] [:error] [pid 16822]     format_deferred()\r\n[Mon Jun 13 13:15:50.782481 2016] [:error] [pid 16822]   File \"/usr/local/lib/python2.7/dist-packages/pdfrw/pdfwriter.py\", line 164, in format_deferred\r\n[Mon Jun 13 13:15:50.782487 2016] [:error] [pid 16822]     objlist[index] = format_obj(obj)\r\n[Mon Jun 13 13:15:50.782492 2016] [:error] [pid 16822]   File \"/usr/local/lib/python2.7/dist-packages/pdfrw/pdfwriter.py\", line 145, in format_obj\r\n[Mon Jun 13 13:15:50.782512 2016] [:error] [pid 16822]     myarray.append(add(value))\r\n[Mon Jun 13 13:15:50.782517 2016] [:error] [pid 16822]   File \"/usr/local/lib/python2.7/dist-packages/pdfrw/pdfwriter.py\", line 83, in add\r\n[Mon Jun 13 13:15:50.782523 2016] [:error] [pid 16822]     result = format_obj(obj)\r\n[Mon Jun 13 13:15:50.782528 2016] [:error] [pid 16822]   File \"/usr/local/lib/python2.7/dist-packages/pdfrw/pdfwriter.py\", line 135, in format_obj\r\n[Mon Jun 13 13:15:50.782533 2016] [:error] [pid 16822]     myarray = [add(x) for x in obj]\r\n[Mon Jun 13 13:15:50.782538 2016] [:error] [pid 16822]   File \"/usr/local/lib/python2.7/dist-packages/pdfrw/objects/pdfarray.py\", line 46, in __iter__\r\n[Mon Jun 13 13:15:50.782543 2016] [:error] [pid 16822]     self._resolve()\r\n[Mon Jun 13 13:15:50.782548 2016] [:error] [pid 16822]   File \"/usr/local/lib/python2.7/dist-packages/pdfrw/objects/pdfarray.py\", line 28, in _resolver\r\n[Mon Jun 13 13:15:50.782554 2016] [:error] [pid 16822]     value = value.real_value()\r\n[Mon Jun 13 13:15:50.782559 2016] [:error] [pid 16822]   File \"/usr/local/lib/python2.7/dist-packages/pdfrw/objects/pdfindirect.py\", line 21, in real_value\r\n[Mon Jun 13 13:15:50.782564 2016] [:error] [pid 16822]     value = self.value = self._loader(self)\r\n[Mon Jun 13 13:15:50.782569 2016] [:error] [pid 16822]   File \"/usr/local/lib/python2.7/dist-packages/pdfrw/pdfreader.py\", line 200, in loadindirect\r\n[Mon Jun 13 13:15:50.782574 2016] [:error] [pid 16822]     source.next()\r\n[Mon Jun 13 13:15:50.782579 2016] [:error] [pid 16822] StopIteration\r\n"}}
{"actor":{"display_login":"tassamartz"}}