About Me

microformats hcard approaching

is a Professional Geek for Microsoft Australia. More info lives underneath the About Box...

-33.831416, 151.222526
MrCell+61.417.212181
Work:
1 Epping Road
North Ryde, NSW 2113
Australia
photo of nick hodge

Stuff

View Nick Hodge's profile on LinkedIn

msdn channel 9

CGI">Adobe Acrobat Reader and Forms Data without Custom CGI

By Nick Hodge | February 26, 2003

Adobe Acrobat, Forms and Email; no cus­tom CGI

Adobe Acrobat 5.0 per­mits the sub­mis­sion of form data via an email con­nec­tion. How­ever, the free Adobe Acrobat Reader does not per­mit the sub­mis­sion of form data to via an email mes­sage, dir­ectly out of the applic­a­tion. Or does it?

As I get this ques­tion about once a week, I decided to research and write a small art­icle about how to imple­ment this using Adobe Acrobat here.

There are two solu­tions: either code your own CGI script in a vari­ety of lan­guages: PERL, PHP, ASP, JSP etc (see: PDF Forms and Javas­cript), or altern­at­ively use one of the most com­mon pre-installed CGIs: Form­mail.

Pro­gram­ming CGI is not a simple “Learn pro­gram­ming CGI in 24-hours” topic. There is a smarter way: by using a CGI that has been “pre­vi­ously cooked in the oven”. Most ISPs and web host­ing organ­isa­tions know that expect­ing every cus­tomer to be a code-jockey is a little steep, there­fore they install some default CGIs. “Formmail.cgi” is a simple CGI that takes form data, and emails the res­ult to a nom­in­ated email account.

What is Formmail?

From Matt Wright’s Form­mail: Form­Mail is a generic HTML form to e-mail gateway that parses the results of any HTML form and sends them to the specified users. This script has many formatting and operational options, most of which can be specified within each form, meaning you don't need programming knowledge or multiple scripts for multiple forms.

As this is an extremely com­mon CGI, you should be able to get your ISP or web server admin­is­trator to install it; or at least a CGI that rep­lic­ates its func­tion­al­ity. Host­for­web is my third ISP/host since early 2002 and each of the pre­vi­ous two also had a Form­mail CGI facility.

So how does CGI and HTML forms relate to Adobe PDF?

Nor­mally, this CGI relies on HTML forms. But aren’t we talk­ing about PDF Forms? With Acrobat, one of the sub­mis­sion formats for forms data is HTML encoded data being received by a CGI. All we need to do is ensure that we sub­mit the PDF form data in a HTML format; and sub­mit fields that the Form­mail CGI recognises.

This also does not require any spe­cial con­fig­ur­a­tion of email applic­a­tion on the cli­ent end. All they need is Acrobat Reader/Adobe Reader installed.

How to Cre­ate the Form in Acrobat

Let’s take the example form: a simple web site feed­back form for this site. I’ll set up this the forms sub­mis­sion occur via CGI-Formmail.

Down­load the form here: Feed­back Form. Open in Adobe/Acrobat Reader and com­plete the form.

This form is a simple feed­back form. If you click on the Sub­mit but­ton, it will send me an email that looks some­thing like this:

[1352] email_response.gif

The cre­ation of form fields in Acrobat is simple: just use the Form tool, cre­at­ing text fields in the places you would like them to appear.

Behind the scenes on this form live 3 hid­den fields. It is extremely import­ant to name the fields with the required names for the CGI. These fields are sent to the CGI and are used to inform the CGI where to send the data, the sub­ject on the email, who the form is sent from. In Formmail’s instance, its needs at least one field: recip­i­ent. In my example, I have added two extra fields: sub­ject (this will be the sub­ject of the email sent to me) and redir­ect (this is where the CGI will return the user once it has sent the email)

[1353] hiddenfields.jpg

Below, I have clicked on the field “recip­i­ent” There are two import­ant things I have con­figured on this field: firstly, the fact that it is “hid­den” — you can­not see it when you are enter­ing data into the form. The second change I have made is to set a default value: the recip­i­ent of the form data.

[1354] recipient.gif

The Sub­mit but­ton has spe­cial options. When you cre­ate the but­ton, in the Actions I have cre­ated a “mouse up, Sub­mit Form” action as below:

[1355] submit-1.gif

[1356] submit-2.gif

When you edit the Action, you can nom­in­ate the URL. In my instance, the URL is http://thedigitalcottage.com/cgi-sys/FormMail.cgi. This URL WILL NOT WORK in your form — you will need to determ­ine from your host­ing pro­vider the URL to their Form­mail install­a­tion. There are some spe­cial anti-SPAM fea­tures in Form­mail that does not per­mit the use of my CGI with your site. To have the PDF form sub­mit the data in a format that Form­mail can under­stand, its import­ant that the Export Format is HTML.

One of the Anti-SPAM fea­tures of Form­mail is restrict­ing who can be the recip­i­ent of a par­tic­u­lar form. You will need to con­sult with your ISP to determ­ine what secur­ity set­tings they have applied to their Form­mail install­a­tion to restrict who the data from the form can be sent to.

Once com­pleted, you load the PDF form or email the form in the nor­mal manner.

Now the final user of the form will be able to Sub­mit data back, without the need of a cus­tom CGI script.

Topics: mungenet | 4 Comments »

4 Responses to “Adobe Acrobat Reader and Forms Data without Custom CGI

  1. IHypF Says:
    May 12th, 2008 at 10:50 am

    Great Per­sona On the Web­siteGreat Work ‚Im Impressed From The Site
    Hil­lary duff photo gallery

  2. sviOq Says:
    June 23rd, 2008 at 10:47 am

    I Just Book­marked Your Site,

  3. xjaiC Says:
    June 26th, 2008 at 12:25 pm

    You REally Have TO See This…, 110cc bike free pocket sale ship­ping, 110cc bike free pocket sale ship­ping, 0148,

  4. walid jaafar Says:
    March 4th, 2010 at 5:40 am

    thanks a lot for the tutorial, great help for me honestly.

Comments