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
Error when using flatten, Could not find page for PDFRef #967
Comments
Hello @neoygdrassyl! I'll need more information to be of any assistance on this. Please fill out the new bug report form and we can continue from there. |
I encounter a similar issue recently. We created a PDF from a Word document and then added fields using Wondershare's PDF Element software. When I try to flatten the form (which is multipage) I get:
I haven't had trouble with the same code for other pages that we created, although those are all single page forms. |
that couldn't be found on any pages. Up until now we've been throwing an exception when dealing with such fields. But it appears that other PDF software are more resilient to this and gracefully ignore them. This commit ensures we'll do the same. Fixes Hopding#967,Hopding#1281,Hopding#1349
I'm currently trying to figure out what is going on.
I fill a form from my PDF and then I need to use flatten in order to "save" the values and then download said PDF.
At the moment of using flatten there is an Unhandled Rejection, as follows
Unhandled Rejection (Error): Could not find page for PDFRef 439 0 R
which I understand means that once the field is flatten, the library will delete the field and uses the ref value of the field in order to do this, in this case, it looks for a field with a ref value of "439 0 R" but it does not exist, so I looked around to see what was said problem, using the following code
and found out that the ref values only go around 200-ish, about the same number of fields from the PDF.
the field "cb_1_8_c " is the last field of the form and has a ref value of "216 0 R"
So, I have no idea what is happening, what is causing the function flatten to use a ref value of "439 0 R" when none of the current fields have such.
The PDF I'm using was a flat document that I later add field forms using online tools.
The text was updated successfully, but these errors were encountered: