These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Close the submitted results window

bruce83
Registered: Jul 22 2008
Posts: 9

Hello,

I've just made a new form with Acrobat Reader Pro 9.0, when I want to submit my form to my PHP script via an URL it works well for the treatment but each time I send the form, I have a new blank PDF document opened (like an HTML page with header/footer) and I would like to know how can I close it?

Regards,

My Product Information:
Acrobat Pro 9.0, Windows
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
What sort of response is the PHP programmed to return?

George
bruce83
Registered: Jul 22 2008
Posts: 9
It is just a PHP script with $_POST lines to collect results from the PDF form and after mail the results with mail()... I tried this morning with a file, 'test.php' with nothing inside, no code, and I have the same problem, the new PDF window when I want to submit my form to this script file.

Regards,
bruce83
Registered: Jul 22 2008
Posts: 9
Answer:

http://www.tgreer.com/pdfSubmit.php
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
There are better ways to respond to a form posting. One way is to return an FDF that causes a popup message to be displayed informing the user of the success or failure of the submission. In the submit action, you have to set it up so Acrobat knows to expect an FDF response, and your server needs to be programmed to return an FDF response, even in error conditions, and use the correct MIME type for FDF.

Another approach is to generate a 204 - No Content HTTP response header, but the user would get no feedback as to the success or failure of the submission.

The point is you should generate a response that Acrobat recognizes without converting the response to a PDF and displaying it, which won't work with Reader anyway.

Note that the method described in that link above won't work reliably for many users since the popup will be blocked, and the form data my be cleared after the submission with certain versions of Acrobat.

George