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

Submit PDF form with http submit button?

webified
Registered: Apr 23 2008
Posts: 5
Answered

I apologize, as it seems to be this topic likely has already been covered. But, I just can't find any historical threads using the "Search Forums" function.

So, here goes:

I need some sample Perl script that would essentially allow a user to send their PDF form results to a recipient's e-mail address without the user having to use their own e-mail application or a Web-based e-mail account (such as Yahoo! Mail or Google Mail.)

The reason is this: Imagine a user at a public kiosk that has no e-mail and no access to Webmail (security filters prevent public access to Webmail accounts, etc.)

The only method that would remain for getting the form submitted would be via the http submit button. My server can only accommodate Perl script. So, it has to be Perl that would process the PDF form data.

I am no good at Perl, but if I could find a sample file of Perl that does what I described above, I can modify it for my server environment, I am sure.

One last requirement: The person receiving the form data needs to be able to view the data as it appeared to the sender in the original PDF. I think this can be accommodated easy enough, but thought I had better mention that, too.

I'm desperate for a solution, as I've spent about four days researching this to no avail. All the documentation suggests this can be done, but I can't get any further than that. Thx in advance!

Ben

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Well, you won't find anything about Perl on this site, so your appolgy is unnecessary.

Acrobat's connection to the outside world is guided by a very narrow and strict security policy. In certain situations, users are given the option to select an email server, but this cannot be controled from the documet. So you are very much correct in the methodology you've outlined. The PDF data needs to be sent to a server via HTTP Post, where it is rerouted to an email server.

Read this article on submitting PDF data.
http://www.acrobatusers.com/tech_corners/javascript_corner/tips/2006/submitting_data/

Perl CGI scripts are pretty simple. If there are only a few fields on the form, with short data (no long paragraphs of text), then you could get away with an HTTP GET that places the data into the HTTP request header. In this case, there is no difference between processing data from an HTML form and processing data from a PDF form. Find and download "CGI.pm". This is a standard Perl header that will do all the heavy lifting for you. You'll find all the information you need in books on Perl CGI and online. There's tons of info.

If however the PDF form has a lot of data, or large data. then you will need to use an HTTP post, which puts one of the PDF data formats into the body of the HTTP Request. In this case you'll need to extract and parse the body content according the the content (mime) type and length in the header.

You'll find everything you need on the Perl/CGI web sites. Once you have the data parsed out of the HTTP request, it's a matter of emailing it off. This is purly Server/CGI scripting. Somthing else you'll find on the Perl/CGI web sites.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

webified
Registered: Apr 23 2008
Posts: 5
So, if I understand this correctly, then a user at a public kiosk -- with no access to Webmail, no access to any e-mail application whatsoever, and no attached printer -- is totally out of luck if they encounter a PDF form with a submit button in it!

In such case, we should be building HTML-based forms, if we know there will be users at public kiosks without access to any sort of printer or e-mail services, right?
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
No, Not at all. The PDF can do an HTTP submit. That's what I was talking about. Read the article at the link in my previous post.

As far as the form data processing goes on the server side. There's very little difference between a PDF and an HTML form.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

webified
Registered: Apr 23 2008
Posts: 5
I read that article in close detail before my post above. There is no way to transmit the PDF -- only its data. The recipient needs the original PDF, filled out, sent back to them.
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
But there is a way to send the entire PDF. If you look in the Acrobat JavaScript reference you'll see that you can set the "cSubmitAs" property in the "submitForm()" function to "PDF", which submits the entire PDF to the server script. If the kiosk is using Reader, then all you need to do is Enable the form for Reader Save Rights, which is a feature in Acrobat Pro.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script