Link to home
Start Free TrialLog in
Avatar of Frylock
Frylock

asked on

Retrieving Data from an Adobe Acrobat Document

Hi,

One of our clients recently sent out a Survey in the form of an adobe acrobat form that allowed participants to enter information into the form.

The survey participants then filled out the pdf document, saved it, and emailed it to us.

How can we extract the data from the .pdf into our database?

I have uploaded a blank example of this survey here: http://www.braynard.com/survey.pdf. Thanks.
Avatar of Karl Heinz Kremer
Karl Heinz Kremer
Flag of United States of America image

Do you have the full version of Acrobat? If so, you have (at least) two different ways to do this: You can either use JavaScript in Acrobat to create a small program that extracts the data and then uses ADBC (which is Adobe's JavaScript wrapper for access to ODBC data sources) to write this information into the database (this does however not work on a Mac), or you can use a VB program that uses Acrobat's API to access this information and write it to the DB.
Let me know which method you prefer, and I can provide some code. Keep in mind however that I'm not programming in VB, but I can give you the commands that are necessary to access the data, I'm more familiar with JavaScript.
Avatar of Frylock
Frylock

ASKER

The first option works - we have acrobat pro.
Avatar of Frylock

ASKER

Ah - new problem. I found advanced>forms>export data.

It exports into some lousy txt file or an XML file. Question is, can I take that xml and put it into a dbf through some automated process? SQL Server and Foxpro don't seem to allow import of an XML.
ASKER CERTIFIED SOLUTION
Avatar of Karl Heinz Kremer
Karl Heinz Kremer
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Frylock

ASKER

How do I know what the field names are? Can you take a look a tthe document I uploaded? Thanks for your help.
Avatar of Frylock

ASKER

Also, I added the .js file to the directory (slightly different from the one you spelled out: "C:\Program Files\Adobe\Acrobat 7.0\reader\Javascripts\db1.js"

And it does not show up under 'Documents.'
Avatar of Frylock

ASKER

btw- I fixed the last problem (Put it in the 6.0 folder) but I cannot get it to show up i ndocuments.
Open up the JavaScript console (Ctrl-J). Do you see any error messages after you start Acrobat?

When you open your document in Acrobat, and select the Select Object Tool (on the Advanced Editing toolbar), you will see all the form field names. On your first page, you'll see for example "State", "Date", "Responding Official", "Title", "Address", "Email", "Phone", Fax Number" and so on.
Avatar of Frylock

ASKER

CTRL-J doesn't show anything.

See here: http://www.braynard.com/adobe.JPG
Where exactly did you place the script?
Avatar of Frylock

ASKER

C:\Program Files\Adobe\Acrobat 6.0\Acrobat\Javascripts

It's called "db1.js" and there are other scripts also in that directory. Since you've been so helpful, I'll double the value of this question to 1000 by setting up another for you later.
Avatar of Frylock

ASKER

Also, I don't see the 'select object tool' under the advanced menu.
The tool is on the "Advanced Editing" _toolbar_, or you can find it as "Tools>Advanced Editing>Select Object Tool".

Check the following setting in Acrobat's Preferences: On the "JavaScript" dialog, is the "Enable Acrobat JavaScript" checkbox selected?
(It should be). Also select the "Enable JavaScript Debugger" setting and try again to see if you get any error messages in the console window.
Avatar of Frylock

ASKER

Hi,

Yes, the javascript is enabled and the "Enabled Acrobat Javascript" is working. There are no error messages.
Avatar of Frylock

ASKER

If you have WinXP I can give you remote desktop control. I can't find the "execute this goddam script" option or even see a list of them anywhere.
Avatar of Frylock

ASKER

Oh wait, I found it. It's called "fill database." I'm new to .js but not to coding. Anyway, it says 'error occured.'
Avatar of Frylock

ASKER

And here's the error:
Acrobat JavaScript Debugger Functions Version 6.0
Acrobat Database Connectivity Built-in Functions Version 6.0
Acrobat EScript Built-in Functions Version 6.0
Acrobat Annotations / Collaboration Built-in Functions Version 6.0
Acrobat Multimedia Version 6.0

TypeError: f1 has no properties
20:Folder-Level:App:db1.js
TypeError: f1 has no properties
20:Folder-Level:App:db1.js
Avatar of Frylock

ASKER

Oh damn, I fixed it. Problem Solved. I can take it from here, mack! Thanks!