3

I have an Adobe PDF Form (FDF) displayed in an <iframe> which I'm using to show the PDF embedded in HTML.

The form has a Submit button. After submission, any output goes to the same frame, so I get an "app-inside-an-app". I need to specify a new target for the form. But since there is no <form> tag in the HTML, the form submission is handled by Adobe, I can't specify the target frame to receive the form result. How can I make the output break out of the <iframe>?

(In case you're wondering why I'm using <iframe>, that's the only way to display inline PDF that works for me. I can't get the <object> tag to work with the dynamic PDF that I am generating programmatically. Thus, the <iframe> is the only option.)

So the question is, any suggestions on how to handle form submission outside the PDF frame? Thanks

gene b.
  • 10,512
  • 21
  • 115
  • 227
  • PDFs have no knowledge of what they're embedded inside. It will just submit to a URL. There's no way to specify a target, since that's an html/dom type thing, and PDF is not part of that. – Marc B Mar 20 '12 at 19:04

1 Answers1

1

I was researching some PDF javascript stuff and I came across an article that may be what you need. I haven't tested it or anything, but thought it may be helpful.

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

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

Note the '#FDF' on the end of the url. If the PDF is viewed in a browser, this tells the browser that it should expect an FDF file as the response. Without this, the browser will treat the response as a regular web page. In this example, 'submitForm' function sends the values in the array 'arr' to 'http://foo.com/saveValues' as HTML key-value pairs. The function also supports a few other options that you can look up later. Perhaps you are 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 a response without having the browser go to a different page. For example, if you want to save some values that the user has entered in the fields of a PDF and send them to a server, you don't want the browser to go to a different page because the user may still be filling in the fields. An FDF response allows you to save without leaving the page, and you can call a javascript function on the return trip. As an example, here is about the simplest FDF you might need:

Ray Perea
  • 5,640
  • 1
  • 35
  • 38
  • I think the #FDF feature may be for Adobe reader only.. http://forums.adobe.com/message/3878224#3878224 – ftrotter Jan 24 '13 at 09:04