Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: '>=' not supported between instances of 'PSKeyword' and 'float' #58

Closed
antoinejdd opened this issue May 30, 2022 · 3 comments

Comments

@antoinejdd
Copy link

antoinejdd commented May 30, 2022

Hi,

For one of the pdf file I want to process, I get the following error :

Traceback (most recent call last):
  File "/home/antoinejdd/Documents/Projects/pdfannots/./pdfannots.py", line 8, in <module>
    pdfannots.cli.main()
  File "/home/antoinejdd/Documents/Projects/pdfannots/pdfannots/cli.py", line 141, in main
    doc = process_file(
  File "/home/antoinejdd/Documents/Projects/pdfannots/pdfannots/__init__.py", line 401, in process_file
    interpreter.process_page(pdfpage)
  File "/usr/local/lib/python3.9/dist-packages/pdfminer.six-20220524-py3.9.egg/pdfminer/pdfinterp.py", line 992, in process_page
    self.device.end_page(page)
  File "/usr/local/lib/python3.9/dist-packages/pdfminer.six-20220524-py3.9.egg/pdfminer/converter.py", line 80, in end_page
    self.receive_layout(self.cur_item)
  File "/home/antoinejdd/Documents/Projects/pdfannots/pdfannots/__init__.py", line 195, in receive_layout
    self.render(ltpage)
  File "/home/antoinejdd/Documents/Projects/pdfannots/pdfannots/__init__.py", line 295, in render
    self.render(child)
  File "/home/antoinejdd/Documents/Projects/pdfannots/pdfannots/__init__.py", line 290, in render
    self.update_pageseq(item)
  File "/home/antoinejdd/Documents/Projects/pdfannots/pdfannots/__init__.py", line 210, in update_pageseq
    x.update_pageseq(component, self.compseq)
  File "/home/antoinejdd/Documents/Projects/pdfannots/pdfannots/types.py", line 246, in update_pageseq
    self.pos.update_pageseq(component, pageseq)
  File "/home/antoinejdd/Documents/Projects/pdfannots/pdfannots/types.py", line 218, in update_pageseq
    if self.item_hit(component):
  File "/home/antoinejdd/Documents/Projects/pdfannots/pdfannots/types.py", line 210, in item_hit
    return (self.x >= item.x0
TypeError: '>=' not supported between instances of 'PSKeyword' and 'float'

This issue seems similar to #54

I can't publicly share the faulty pdf file, but I can send it to you in PM.

@0xabu
Copy link
Owner

0xabu commented May 30, 2022

Hmm, PSKeyword sounds like a different bug. Can you email me the PDF (or a link to it)?

0xabu added a commit that referenced this issue Jun 3, 2022
…targets

This "fixes" issue #58 by emitting warnings as intended and ignoring the wonky outlines.
@0xabu
Copy link
Owner

0xabu commented Jun 3, 2022

This should be fixed by the above-referenced commit. The PDF file does seem to have screwy outlines/bookmarks, so there are a bunch of warnings, but you get annotations output now. Thanks for the report!

@0xabu 0xabu closed this as completed Jun 3, 2022
@antoinejdd
Copy link
Author

Thank you ! Like you said, this is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants