-
Notifications
You must be signed in to change notification settings - Fork 510
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
RuntimeError: source object number out of range #856
Comments
Is that PDF large? Should this be confirmed, there are obvious ways to "immunize" your script ... |
Hi @JorjMcKie, Spot on! That worked like a charm. I did try the
in order to keep it all in memory and not have to write it out to file and reread that file. Thanks for the quick response! Its been awesome working with this library. |
Good to hear that.
The cleaning is implicitely done if you use |
Maybe it is also worthwhile to explain, why
So when a non-existing source xref is referenced here, then a damaged source page would become part of the target PDF ... |
close issue? |
Thanks for the explanation @JorjMcKie! its very helpful. |
Describe the bug (mandatory)
When trying to combine two pdfs; I receive the following exception:
RuntimeError: source object number out of range
To Reproduce (mandatory)
I simply load two pdfs and try combine them. It works for 99% of pdfs but for a few i hit this issue and trying figure if there is a way to detect that there will be an issue before trying to merge.
I tried loading the PDFs directly using
fitz.Document(<filename>)
, but get the same results. I could even send you the PDF.Expected behavior (optional)
I expect the method to be successful.
Your configuration (mandatory)
Let me know if you want me to send the PDF that is breaking. Perhaps there is a method i could use to determine that the PDF is incompatible.
The text was updated successfully, but these errors were encountered: