Adobe FDF (PDF form) Submit button - to another frame?

I have an Adobe PDF (FDF) form displaying in <iframe>

which I am using to show a PDF embedded in HTML.

The form has a "Submit" button. After sending, any output goes to the same frame, so I get "application inside inside". I need to specify a new target for the form. But since there is no tag in HTML <form>

, the form submission is processed by Adobe, I cannot specify the target frame to get the form result. How to draw a conclusion from <iframe>

?

(If you're wondering why I'm using it <iframe>

, this is the only way to display an embedded PDF that works for me. I can't get the tag <object>

to work with a dynamic PDF that I'm producing programmatically. So that <iframe>

's the only option.)

So the question is, what suggestions on how to handle form submissions outside of the PDF frame? Thanks to

+3


source to share


1 answer


I was looking into some pdf javascript stuff and I came across an article that might be what you need. I haven't tested it or anything else, but thought it might be helpful.

http://leeboyge.blogspot.com/2011/07/sending-fdf-response-back-to-pdf.html



You just need to add #FDF at the end of your url. Here is a quote from this article.

Notice the '#FDF' at the end of the url. If the PDF is viewed in a browser, this tells the browser to expect an FDF file as a response. Without this, the browser will treat the response like a regular web page. In this example, the "submitForm" function submits the values ​​in the "arr" array to "http://foo.com/saveValues" as "key" character pairs. The function also supports several other parameters, which you can see later. You might be wondering why we want an FDF response instead of some other type of response. The answer, in my case, is that it gives the PDF document in the browser the response without the browser navigating to another page. For example, if you want to store some of the values ​​entered by the user in the PDF fields and send them to the server, you don't wantto make the browser navigate to another page because the user can still fill in the fields. FDF's answer allows you to save without leaving the page and you can call the javascript function on the return path. As an example, consider the simplest FDF you might need:

+1


source







All Articles