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

KeyError: '/XObject' #5

Open
MartinThoma opened this issue Sep 7, 2020 · 0 comments
Open

KeyError: '/XObject' #5

MartinThoma opened this issue Sep 7, 2020 · 0 comments

Comments

@MartinThoma
Copy link

Traceback (most recent call last):
  File "pdf-watermark-removal.py", line 127, in <module>
    main()
  File "pdf-watermark-removal.py", line 117, in main
    process_page(pdf, i, i < args.skip)
  File "pdf-watermark-removal.py", line 66, in process_page
    content = pdf.getPage(page_index)['/Resources']['/XObject'].getObject()
  File "/home/math/.pyenv/versions/3.8.4/lib/python3.8/site-packages/PyPDF2/generic.py", line 516, in __getitem__
    return dict.__getitem__(self, key).getObject()
KeyError: '/XObject'

I recommend to use pdfminer.six instead of PyPDF2, because pdfminser.six is maintained and PyPDF2 isn't.

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

1 participant