Don’t want to write CGI? Try this: Adobe Acrobat Reader and Forms Data without Custom CGI
Part 1: Insert into a database.
Creating the PDF
The first step is to create the base form. Here, the simple form is created in Microsoft Word 2000. Using the PDFMaker, covert the document into a PDF.
Adding the Form Fields
Adding the form fields is a matter of using the Form tool ( i) to create four fields in the areas as indicated by the original Word areas.
Select form tool and drag out the form field filling to the area required.
You can copy and paste or ight click to copy, right click to paste to duplicate fields.
Double click on the field to edit the Field Properties. The scripts below nominate specific fields
Adding a Button
To create a button, use the same field tool as above and create it in the area required. Change the type to Button from the Type: popup menu.
Code example 1: Simple ODBC Insertion from a PDF form.
NB: Before this script will work, there needs to be an ODBC database source on your machine mapped to a database containing the table: ‘jobs’. This table will need at least 4 columns defined: ‘name’, ‘age’, ‘skills’ and ‘years’ I use Microsoft Access as my development database. Using Control Panels>Administrative Tools>Data Sources (ODBC) control panel, I have created an ODBC connection to the jobs.mdb file (Microsoft Access). This can be any ODBC datasouce.
Code example 2: Extending the example above, showing web submission alternative. The ASP referenced is in code example 3 below.
The Active Server Page (ASP)
Code example 3: Active Server Page (ASP) using VBScript inserting the fields the form submits in code example 2.
NB: this code example requires an ODBC connection defined named ‘jobs’ This points to a database that contains the table ‘jobs’ with fields ‘name’, ‘age’, ‘years’, ‘skills’
Also installed is the Adobe FDFTK – Forms Data Format ToolKit. The Windows installer is available here.
For More Information
Adobe Systems’ information on the Forms feature of Acrobat is here.