So I started out thinking this would be a super easy thing to implement. I had an awesome PDF that I wanted to put on-line and have people fill out and hit a button and have it saved on my server. (eventually I'd love it if it was submitted to my dropbox.) Looking high and low I couldn't find anyway to do this. I even spent an hour on chat with adobe and had a case subsequently submitted and then escalated to senior support and after 2+ hours on the phone they still don't know what to say. For the submit form options the bottom one is submit the complete PDF and when I choose that nothing gets saved to the server instead a PDF gets created showing an index of the directory that I'm trying to save it to. Finally I decided that maybe I would just have the data submitted as fdf and then put into the PDF and re saved. So after finding this link< http://koivi.com/fill-pdf-form-fields/tutorial.php > I can now have the filled out information submitted as a fdf file! But can't figure out how to have the fdf put back into the PDF and flattened and saved.
So in short I'm looking to have a PDF filled out and submitted/saved back on the server. Either by submitting the complete PDF or submitting the fdf file and put back into the PDF.
If anyone can help me with this I'd be eternally greatful to you!!!
In either case you will need to have a program on the server whose job is to process the submission, so something with the PDF or FDF, and return a response. In the cse of the complete PDF, this program (Perl script, PHP, ASP, Cold Fusion script, etc.) would take the entire contents of what is submitted and save it to a file on the server. The point is is doesn't happen automatically. When you set up the Submit Form action, you specify the URL of the server-side program that does the processing.
In the case of FDF, the server could get it and merge it with a PDF, but this is normally done with a server-side component such as Appligent's FDF Merge or some component of Adobe's LiveCycle offerings.
Finally, the server has to return a response that can be understood by the client. In the case of a submission from Acrobat/Reader, this can be FDF, which can provide some user feedback, redirect to a static or dynamically generated HTML page, or an empty response.
This all means that you or someone else needs to do some programming. It not necessarily all that complicated, but it helps a lot to have some expertise in this area.
Awesome thank you so much for the reply/info! Do you or does anyone else have an example of what a program or script would look like for either of the two options? Either to take the entire contents and save it to a file on the server or to merge the FDF data with a PDF? Or any direction of where to look or where to begin?
The submission arrives on the server as the input stream, so in PHP you can simply read it and write it back to a file.
See the example in http://tv.adobe.com/watch/acrobat-community-tv/working-with-form-data/
PHP used to include support for FDF parsing, but it's been depreciated. You can still get the libraries though, and put the classes back (along with a copy of the FDF Toolkit binaries) - see http://php.net/manual/en/book.fdf.php - but if you send XFDF data you can parse it easily as it's just XML.
Also, bear in mind that recent security changes in Acrobat and Adobe Reader mean that if you're viewing the PDF on the desktop, FDF responses from the server will be blocked if they try to change the document or execute a script (such as filling in a form value or opening an alert box). If the PDF is running in a browser and the submission is to the same domain as the PDF was served from, the response will be allowed to run.
I appreciate your reply but how do I "simply read it and write it back to a file."?
Does anyone have an example or starting point for this? An example for just one field, no validation and a submit button would be greatly, greatly appreciated!
Thank you for your reply!
As far as set up to install PHP scripts on the server and basic studying of PHP, the only thing that I have done with PHP is what I found here <http://koivi.com/fill-pdf-form-fields/tutorial.php > and was able to get that to work. So if in order to follow that tutorial means I am set up to install PHP scripts on the server then yes, but if not then I'm not sure. I dont' know what you mean by install on the server. And basic studying of PHP not really.
But if you or anyone could give me an example for just one field, no validation and a submit button I would have starting point and am confident I'd be able to figure out the rest.
Ok, when you typed in that PHP it was stored on your web server (I assume it was, since that's where it will need to be to make it work for anyone but you). So that's what I meant by "install PHP scripts on the server".
Before talking any more about how to get the full PDF, I think it's worth talking more about the FDF. FDF files are actually more useful than you perhaps realise. When you have collected a lot of them, they are a whole lot easier to work with and analyse than the filled in PDF. It can save you a bunch of money in some cases too.
What is your objection to FDF files? What is that you (believe that) you can't do with them that you can do with a filled PDF?
I agree that there is a lot of of aplication with FDF files. But sometimes we have people sign documents or we don't want it editable so to have a flattened PDF would be great. Is there any way to do that with FDF files?
Europe, Middle East and Africa