Skip navigation.
Home

posting data from a PDF form to a web script

This took me awhile to figure out, so I thought I'd put it here FWIW:

Open Acrobat and launch the Designer: click Forms on the Tasks toolbar > Create New Form (or Edit Fillable Form if one is already open)

Insert form fields as desired, naming each one via the Binding tab in its Object Window (click Window > Object if it's hidden). For example, say you insert a text text and name it txtName

Insert > Standard > HTTP Submit Button

In the URL field in the button's Object window, enter the url of the script to receive the data

Highlight the submit button and click the XML Source tab. Below the tag, near the tag for the button, find and change format="formdata" to format="urlencoded"

Save the PDF, saying yes when asks you if you're sure you want to modify the XML manually. Post the PDF on a website.

In the script that is to receive the data, use something like this in PHP:
<? $name = $_POST["txtName"]; ?>

or this in ASP: <% name = Request("txtName")>

Then add code to send it in a message, save to database, etc., just as if it came from a regular HTML form.


Good topic for future meeting

This would be a good topic for a future meeting. You could show how you created the PDF form, and received the data on the web site.


how to change settings to prevent the problem

If you make the following change, the XML Source will be correct when you insert a standard HTTP Submit Button with the Designer as above:

1) browse to C:\Documents and Settings\[user]\Application Data\Adobe\Designer\en\objects\standard
2) open the file HTTP Submit Button.xfo in notepad
3) edit line 36 to read
<submit format="urlencoded" textEncoding="UTF-8"/>
4) save the file


how to post data from a PDF form

Here's a revised version of how to post data from a PDF form on the web:

1) Be sure the Http Submit Button.xfo file has been changed as shown above.

2) Open Acrobat and launch the Designer: click Forms on the Tasks toolbar > Create New Form (or Edit Fillable Form if one is already open)

3) Insert form fields as desired, naming each one via the Binding tab in its Object Window (click Window > Object if it's hidden). For example, say you insert a text field and name it txtName

4) Insert > Standard > HTTP Submit Button
In the URL field in the button's Object window, enter the url of the script to receive the data

5) Save the PDF and post it on a website.

6) In the script that is to receive the data, use something like this in PHP:
<? $name = $_POST["txtName"]; ?>

or this in ASP: <% name = Request("txtName")>

Then add code to send it in a message, save to database, etc., just as if it came from a regular HTML form.