-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 while loading some documents, caused by _cmap.py, line 93 #2286
Comments
@elhele
and check weither it fixes the error |
Hello @pubpub-zz thank you so much for such a fast reply! "indirect_object" in the code above doesn't seem to be defined. If I change it in such a way, it works perfectly and fixes the error:
|
@elhele A PR with the fix was created. I guess until end of the week we will have the fix on PyPI. I'm curious which program created the bad PDF. Can you share that?
It should be something like:
I'm especially interested in the /Creator and /Producer. |
@MartinThoma thank you very much! That's what I'm getting:
I'm also getting this error only with one page of one document in my database. This page looks kind of misplaced and I don't think that this problem occurs very often. |
Fixes #2286 Co-authored-by: pubpub-zz <4083478+pubpub-zz@users.noreply.github.com>
While using the library I'm getting the following error:
TypeError: unsupported operand type(s) for /: 'IndirectObject' and 'int'
Environment
Which environment were you using when you encountered the problem?
macOS-10.16-x86_64-i386-64bit
pypdf==3.17.0, crypt_provider=('cryptography', '37.0.4'), PIL=9.0.1
It happens locally as well as during Azure-deployment.
Code + PDF
This is a minimal, complete example that shows the issue:
Unfortunately I cannot share the document that causes the problem as it contains sensitive information. I also couldn't reproduce it with other documents. This adjustment after line 89, however, solves the problem:
Traceback
This is the complete Traceback I see:
The text was updated successfully, but these errors were encountered: