Solved

Email submission button on Adobe Acrobat 6 form

Posted on 2004-04-29
26
1,016 Views
Last Modified: 2012-06-27
I use Adobe Acrobat forms on my website.  I want to add to the forms a submit button that will email the form back to me complete with the information.  How can I do this?   I am relatively Adobe Acrobat savvy but I have no clue where to start (i.e. I will need step by step instructions).

Thanks in advance!!!
0
Comment
Question by:d_springer
  • 14
  • 12
26 Comments
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10954293
I assume that your clients will use the free Reader, in this case "Submit" does not mean sending by email, it means submitting to a web server. Reader also cannot send the PDF with the form data, it can only submit the forms data. How familiar are you with CGI programming? You can use the same CGI script on your server that you would use for a web form. Reader can use the same forms submission mechanism as a browser, so in case you have a web based forms solution, it's very easy to convert this to a PDF forms based solution.

You can also submit the forms data as FDF file. If you open this FDF file, it will automatically (if created correctly) open the associated PDF file and fill in the forms fields with the data form the FDF file.

With the full version of Acrobat, you can submit forms data via email, and you can also submit the full PDF with the forms data.

0
 

Author Comment

by:d_springer
ID: 10954596
You are right most of my visitors are going to be using the free reader.  I thought that they would be able to at least save the form data and email it back to me.  I find it stupid that Adobe makes this an unusable option unless you have the pay version.

Currently I am hosted on a Linux server and use Formail for my web based forms.  Regarding my programming knowledge - Let's just say I was thrilled when I got my Formail.pl script to work.

I did a little research on FDF and came across http://forums.devshed.com/showthread.php?t=71168&page=2 it seems they are trying to work through a similar issue to mine.

Is it a hard process to setup the forms to be emailed back to me with the data saved in them or is that not going to happen using the free reader?  If not is there another option that I can use with a limited programming knowledge?

Thanks for all your help!
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10955035
Maybe you misunderstood: The feature is not useless, you can submit forms data to a web server. This is actually the better solution in an environment where you don't have control over the email setup. Do you know that all of your users have configured their local email system? There are enough users out there that only use web mail like hotmail.com or Yahoo mail. Your solution would not work for these users. More important, they may have some email setup on their local machines, which means that it looks like the email was submitted, but never will make it to a server on the Internet. When the form gets submitted back to your server, you know right away that it did work.

If you are already using Formmail, just use it with the PDF forms. All you need to do is configure the submit button for HTML submission of the forms data and specify the URL of your FormMail address. To let FormMail know where to send the email to, you need to create a hidden form field named "recipient" on your PDF form.
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10955047
If you want to pass in more information, you need to create more hidden fields (e.g. for the subject field).
0
 

Author Comment

by:d_springer
ID: 10955266
I am really glad to hear that I haven't spent several hours configuring all my Adobe Acrobat pages for nothing.

Within Adobe Acrobat 6.0 how do I "configure the submit button for HTML submission of the forms data and specify the URL of your FormMail address"?

Thanks!!!
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10958270
Create a new button on your form. When you place the button, the properties window will open. Select the "Actions" tab. From the "Select Action" list select the "Submit a Form" entry and click on the "Add" button.
This will bring up a dialog that lets you set the details for the forms submission. You have a choice of what actually gets submitted: FDF, HTML, XFDF or the complete PDF. When you select HTML, you can use FromMail, because the submission method is exactly the same that would be used by a web form. So, select HTML and then go to the URL field and specify the path to your FormMail page.
Don't forget to create hidden text fields with the correct names (e.g. recipient) so that FormMail has all the information it needs to send out the email.
To create a hidden text field select the text field tool and create a new text field. On the properties dialog select the "General" tab. In the Common Properties group box select "Hidden" from the "Form Field" list. Check the "Read Only" checkbox, so that it cannot be modified by accident.
0
 

Author Comment

by:d_springer
ID: 10959928
HERE IS WHERE MY LACK OF PROGRAMMING KICKS IN....................

I added the button exactly as you said.  When I click on the button I get:

"General Error    http://www.sovereignfunding.com/formail.pl".

I don't know if this is part of the problem but when I enter http://www.sovereignfunding.com/formail.pl into my browser I get the error page:
=====================================================================================================
Forbidden
You don't have permission to access /formail.pl on this server.
--------------------------------------------------------------------------------
Apache/1.3.29 Server at www.sovereignfunding.com Port 80
=====================================================================================================



Regarding the second part:
=====================================================================================================
Don't forget to create hidden text fields with the correct names (e.g. recipient) so that FormMail has all the information it needs to send out the email.
To create a hidden text field select the text field tool and create a new text field. On the properties dialog select the "General" tab. In the Common Properties group box select "Hidden" from the "Form Field" list. Check the "Read Only" checkbox, so that it cannot be modified by accident.
=====================================================================================================


In relation to the submit buttor where do I "create hidden text fields with the correct names (e.g. recipient) so that FormMail has all the information it needs to send out the email."   I am really unsure specifically what to do here.

Many Many Sorry's for my lack of knowledge on all of this!
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10960303
Looks like we are using two different packages: formail.pl vs. FormMail.pl (one 'm' vs. two 'm'). When you first typed formail.pl, I assumed that this was a typo, but I know checked, and there really is a formail.pl, which I'm not familiar with.
I need some time to get familar with formail.pl before I can give you any more advice. Unfortunately, I won't have time for this until tonight.
0
 

Author Comment

by:d_springer
ID: 10960524
OOPS!

I used the wrong FormMail.pl.  The correct one is located here: http://www.sovereignfunding.com/cgi-bin/FormMail.pl.

When I put in the correct url into the Adobe Acrobat Submit Button I got the error message:

Error: Bad/No Recipient
There was no recipient or an invalid recipient specified in the data sent to FormMail. Please make sure
you have filled in the recipient form field with an e-mail address that has been configured in
@recipients. More information on filling in recipient form fields and variables can be found in
the README file.
FormMail V1.92 © 1995 - 2002 Matt Wright
A Free Product of Matt's Script Archive, Inc.

This must be the second part of the equation that I haven't done yet.
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10960604
I recognize this error message :-)

You are correct, this is about the second part of my comment. For testing purposes, it's not important that you hide your text field, so just create a new text field on your form (anywhere, any size). When the properties dialog comes up, go to the "General" tab and type the string "recipient" (without the quotes) into the "Name:" field. Then go to the "Options" tab and type your email address into the "Default value:" field.
FormMail will check the form data that is posted for certain field names (e.g. recipient, subject, ...) and will use this information when it generates it's email message.
Once you've made this change, you should be able to send the forms data to your email account.
0
 

Author Comment

by:d_springer
ID: 10960872
It worked.

Two final questions.

1) Is there a way to change the default page that appears after the page has been successfully been sent?

2)  Is there any way that the form can be sent intact or easily repopulated back into Acrobat to save me from having to do it manually?  The main reason for my forms were to have a method of having the applications filled out by the client rather than me having to do it.

0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10960987
1) Create another hidden form field named "redirect" and set the value to the URL you want to use as your "thank you" page.
2) Yes, this is what FDF is for. Try this: Copy your PDF form to your local machine (e.g. to your Desktop) and fill out the form field. Don't click on the Submit button, but select the "Advanced>Forms>Export Forms Data" menu item in Acrobat Professional. Save this file to the Desktop as well. Close Acrobat and double-click on the FDF file. This will bring up Acrobat, will load your PDF file and will initialize the form fields with the data from the FDF file. As you may remember, you can also submit the full FDF file to the server (and mail this as an email attachment to you). You can also import a FDF file into your open PDF document (Advanced>Forms>Import Forms Data), so that you don't have to close the already open PDF document just to read the forms data. If this is what you want, you need a different CGI script on your server. Do you have PHP installed? The link that you posted earlier does exactly this with a PHP script.
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10961032
BTW: This page http://www.nethere.com/support/webhosting/unofficial-guide-formmail.html lists all the things you can customize (with examples) in FromMail.pl
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:d_springer
ID: 10961564
In my simplistic dreams I had envisioned receiving an email with an attachment that contained the clients data filled out just as they typed it in on my form.

In your opinion which of your above methods would provide that or close to that?
0
 

Author Comment

by:d_springer
ID: 10961606
Sorry,  Yes PHP is installed.
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10961769
The FDF solution will let you recreate the filled in form (based on the original PDF, merged with the FDF data).
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10965017
If you use the PHP script found here http://forums.devshed.com/showpost.php?p=382992&postcount=24 and configure it and save it to your web site (e.g. as /FDFMail.php), you can then change the forms submission type to FDF and use the FDFMail.php script as your CGI handler.
This will forward the complete FDF file to your email account. Once you receive that, you can import it into your PDF file and it will look exactly like the form looked like when your client submitted it.
0
 

Author Comment

by:d_springer
ID: 10971599
khkremer,

This is what I have done.

1) In the Adobe Acrobat Form I changed the SUBMIT button Actions to
a) Enter a url for this link: http://www.sovereignfunding.com/cgi-bin/FDFMail.php
b)Export format: FDF Include with field data checked

2) I made minor changes to the script below but I know that I probably have left items out.

When I open the form here: http://www.sovereignfunding.com/test.htm and press the submit button I get this error:
=================================================
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, root@sovereignfunding.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
--------------------------------------------------------------------------------
Apache/1.3.29 Server at www.sovereignfunding.com Port 80

The PHP script I am using is below:
=================================================
<?php
// $form_name is provided in the url that calls this page, allowing this page
// to be called from different PDF's, yet customized for each one
$date = (date ("m/d/y"));
$time = (date ("H:i:s T"));
$tmpname = (date ("mdy-His"));

$message = '
This is a multi-part message in MIME format.

------=_NextPart_000_0007_01C37EC6.3F062EA0
Content-Type: text/plain;
    charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

A '.$form_name.' was submitted from the sovereignfunding.com website at '.$time.' on '.$date.'.

(attachment: '.$form_name.')

------=_NextPart_000_0007_01C37EC6.3F062EA0
Content-Type: application/vnd.fdf;
    name="FDF-'.$tmpname.'.fdf"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
    filename="FDF-'.$tmpname.'.fdf"

'.$HTTP_RAW_POST_DATA.'

------=_NextPart_000_0007_01C37EC6.3F062EA0--

';

$recip = "funing_quote@sovereignfunding.com";
$subject = $form_name;
$headers = "From: xxxxx <xxxxx@xxxxx.com>\n";
$headers .= "Return-Path: <xxxxx@xxxxx.com>\n";
//use the following line for bcc:
//$headers .= "bcc: [email]xxxxx@xxxxx.com[/email]\n";
$headers .= "Content-Type: multipart/mixed; boundary=\"----=_NextPart_000_0007_01C37EC6.3F062EA0\"\n";

$status = mail($recip, $subject, $message, $headers);

Header("Location: nextpage.php");
=================================================

Can yo tell me what I have done wrong.

MANY THANKS!!!!!

David
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10971970
Your script needs to end with a line like this:
?>

This is missing from the script you posted. It may just be a cut&paste error, but this may also be the reason for your problem. Before we go any further, please verify that you do have the correct last line in your script.
0
 

Author Comment

by:d_springer
ID: 10972010
khkremer,

I added the ?> to the last line.  Then I held by breath and pressed Submit but the same exact error occured.  It is never that easy is it?

David
0
 

Author Comment

by:d_springer
ID: 10973148
khkremer,

I checked my servers error.log and this is what is said:
[Sun May  2 15:43:27 2004] [error] (13)Permission denied: exec of /vservers/sovereignfun/cgi-bin/FDFMail.php failed
[Sun May  2 15:43:27 2004] [error] [client 68.55.19.165] Premature end of script headers: /vservers/sovereignfun/cgi-bin/FDFMail.php

Here is the script:

<?php
// $form_name is provided in the url that calls this page, allowing this page
// to be called from different PDF's, yet customized for each one
$date = (date ("m/d/y"));
$time = (date ("H:i:s T"));
$tmpname = (date ("mdy-His"));

$message = '
This is a multi-part message in MIME format.

------=_NextPart_000_0007_01C37EC6.3F062EA0
Content-Type: text/plain;
    charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

A '.$form_name.' was submitted from the sovereignfunding.com website at '.$time.' on '.$date.'.

(attachment: '.$form_name.')

------=_NextPart_000_0007_01C37EC6.3F062EA0
Content-Type: application/vnd.fdf;
    name="FDF-'.$tmpname.'.fdf"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
    filename="FDF-'.$tmpname.'.fdf"

'.$HTTP_RAW_POST_DATA.'

------=_NextPart_000_0007_01C37EC6.3F062EA0--

';

$recip = "funding_quote@sovereignfunding.com";
$subject = $form_name;
$headers = "From: xxxxx <xxxxx@xxxxx.com>\n";
$headers .= "Return-Path: <xxxxx@xxxxx.com>\n";
//use the following line for bcc:
//$headers .= "bcc: [email]xxxxx@xxxxx.com[/email]\n";
$headers .= "Content-Type: multipart/mixed; boundary=\"----=_NextPart_000_0007_01C37EC6.3F062EA0\"\n";

$status = mail($recip, $subject, $message, $headers);

Header("Location: nextpage.php");
?>

0
 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 500 total points
ID: 10973400
Sorry for the delay.

This should be easy: A PHP program is not a CGI script, therefore it should not be in your cgi-bin directory. Put this into your htdocs directory (or any subdirectory of it). The PHP file will be handled like a .html file, with the small difference that it's processed by the PHP interpreter first.
So, just move the file to a directory where you would also store HTML files and try again. You need to change your URL in the Acrobat form to reflect the new location.
0
 

Author Comment

by:d_springer
ID: 10974448
khkremer - THANKS!!!
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10975891
I assume it worked :-)
0
 

Author Comment

by:d_springer
ID: 10977723
khkremer,

I am having a minor problem with the script.  I posted the issue in the PHP section.  Maybe you will have some idea what the problem is.


http://www.experts-exchange.com/Web/Web_Languages/PHP/PHP_Installation/Q_20975595.html
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10984803
Looks like you figured it out. My PHP experience is very limited, so my suggestions may not have helped you :-)
If you have any problems with the PDF/FDF part of your solution, please feel free to post our followup questions in this question.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

*Adobe Acrobat 9 was used for this article. Particular steps may vary depending on software versions. 1. Create a framework of your form in Word, leaving space where you’d ultimately like the Adobe fields to appear.  (Note: I use the blank lines …
PaperPort is a popular document imaging/management product from Nuance Communications (http://www.nuance.com/). It is in widespread use by both individuals (http://www.nuance.com/for-individuals/by-product/paperport/index.htm) and businesses (http:/…
In this video, we show how to perform Bates Numbering/Stamping of PDF documents using Power PDF Advanced, the newest product from the Document Imaging division of Nuance Communications. There are two editions of Power PDF — Standard and Advanced. Th…
In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now