Previous | Next | (P-PDF) Forms & FDF
Topic: Need an example PDF form that submits FDF
Conf: (P-PDF) Forms & FDF, Msg: 155781
From: johnlabella
Date: 11/3/2006 11:35 PM
YOu asked for an example of a PDF form that submits to FDF?
This script may be what you asked for:
Create a button called "Submit" on the PDF. Go to "Actions, mouse up" and and Add a JavaScript (Acrobat 5 approach, not sure if it's different in versions 6 or 7). Then paste the following java script into the console window. This script directs the PDF to export ONLY SELECTED FIELDS to the fdf, and it exports them to the local computer on which the original PDF resides. You can then email these FDFs to someone else - but the recipient will need to 1) have the same Master PDF form in order to view the FDF data, or else 2) you will need something like FDF converter, which turns FDF files into a .csv file, allowing you to view many FDF files as rows of data. (BYW, I really like FDF converter from PDF-office.com and use it alot. The instructions could be a little clearer for laypersons such as myself, but it's cheap and very effective for what we do)
Note that you will need to edit the following script to contain *only the names of the fields that your own PDF contains*. If you make a mistake and type a field name in the script below that does not exist on your PDF, then the fields following in the script may not save to the FDF file - so watch those typos!
Note also that if you use FDF converter, things will get complicated if you try to export more than 256 fields from a PDF.
Best wishes,
John LaBella
******
javascript begins - you can add more fields to this script.
//Export Data from these fields ONLY
var myArray = new Array();
var i =0;
//Build Array to Export
myArray[i]= "agencyExit-exitDate";
i++;
myArray[i]= "agencyName";
i++;
myArray[i]= "bedNight-exitDate";
i++;
myArray[i]= "bedNight-intakeDate";
i++;
myArray[i]= "bedNight-quarterlyTotal";
i++;
myArray[i]= "bedNight-SafeHome";
i++;
//Export Array as FDF
this.exportAsFDF(true, true, myArray);