Detailed description of issue
Trying to merge form data into a PDF which has had form data merged into it multiple times in the past fails with error 504 from https://api.pdfjs.express/xfdf/merge
Does your issue happen with every document, or just one?
Every document once a certain amount of past merges have happened
That would be much appreciated Logan. We have trained our clients to just edit the pdf and re-save with each change, but after they do this 2 or 3 times, it hangs when they try to open it.
I unfortunately cannot reproduce your issue no matter how many times I try merging annotations into the document, even with the file and XFDF you sent over.
Are you able to give me access to the environment where you can reproduce this? Are you able to provide exact steps to reproduce?
Hi Logan - the cURL request given is one of the actual requests that was sent and then returned with error 504. I captured it from the Chrome Developer Tools.
I could PM you login info to reproduce it from in our software if you would like.
I cannot reproduce your issue even with the exact XML and document you provided.
The only weird thing I see in your request that I don’t see in mine is the thousands of \r in the file’s binary in your request - I am not sure where those are coming from and I don’t see that on my end.
If you could DM me credentials that would be great.
Logan we now have multiple customers with this bug, this is critical for us please respond - you wanted us to DM you credentials and we wanted to know a secure way to do that
I am able to reproduce the problem in your environment but I cannot reproduce the issue on my end still.
A 504 error indicates that the process is timing out which means the operation you’re trying to do is too complex, which usually indicates an issue with the document, form, or the XFDF.
I believe the issue is something to do with the document itself or some kind of customization you have made. If you could send over any other code you are calling to customize the document, form, or XFDF, that would be great. Also, if you could send me the exact document that’s getting sent to the server that would be great (the document you have sent me does not appear to match the document I see in your environment).
Hi Logan, this is Ryan - I emailed you a link which demonstrates the issue with minimal code (and the code can be viewed by inspecting the page).
As of just a few moments I have updated the link so if you have taken a look at it between receiving the email and now, please disregard what you saw earlier.
What you will see when going to the link now is that PDF JS Express loads a PDF that our customer uses as a template. This PDF is fresh from Acrobat, never run through PDF Express JS before. Once PDF JS Express loads up, press the Save button at the bottom. A new Blob will be generated using the PDF JS Express API, and if successful, PDF JS Express will close and the new Blob will be loaded into a new PDF JS Express instance. Repeat the process. Each time the new Blob is loaded, press Save again, and after 2-3 iterations you will notice that it stops working due to the 504 error.
Just letting you know that I can finally reproduce your issue on my end. I’ll investigate and get back to you ASAP. Thanks for setting up that environment for me and thanks for your patience.
Update - this is a pretty complex problem that we’re not sure the root cause of at the moment. I’m working with our core team to try and find a solution but it might be a while before we find a good fix.
As a temporary solution, you can try using the set endpoint instead of merge - this should resolve the problem. The only side effect is that any annotations that are baked into the document that you are not extracting will be removed (since set replaces all the annotations on the document with the XFDF you provide). I would give it a try and see if it works for you for now.