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

How to Extract the LC Form Fields Values and Store them to Database.

tarekahf
Registered: May 1 2008
Posts: 91

Dear All,

I really need URGENT Help.

We have designed a huge LiveCycle Form using Adobe LiveCycle 7.1, and it is a very huge form, with a total of more than 100 fields.

The form will be submitted by the clients using the Standard Email Submit Button, and the PDF Data will be attached to an Email as XDP Package which is sent to a pre-defined Address.

When the Emails are received by the Person in charge, he will save the Data Files each one with a unique name on a local folder.

When finished receiving all the Data Files by Email, he will use Adobe Acrobat Utility from the menu "Advanced/Forms/Create sheet from Data Files", and this tool will allow the user to select all the saved Data Files and it will convert them to CSV File as you may already know.

The format of the Data Elements on the PDF Form is very complex as it has many repeating elements (1-to-may relationship) such as the Applicant Data and list of his Experience, for example:

some name
1/1/1970

Some Organization 1

Some Organization 2

Some Organization 3

When converted such XML Data from the PDF into CSV, the result looked very complex, as the Repeating Elements were converted to columns with index counter. This is making it nearly impossible to write a program to work with such CSV Format and convert it to a Database Structure in the 3rd Normal Form.

Objective:

Write a program or some script to fully automate the extraction of the XML Data from the PDF Forms Files and convert it and store it in a Database Structure in the 3rd Normal Form.

Remember that we will have many files stored in the a folder which has PDF Files with XML Data Embedded in them.

One option I found is using OLE or Acrobat IAC from .NET, but I am new to this area, and the project is very urgent.

We will accept professional service as the User in Charge confirm to me that they can contract with 3rd party developers to support us in that regard.

Any one can help will be appreciated.

Following is a quick spec of the required .NET program :

1. Enumerate through all the PDF Files in a given folder (based on Adobe LiveCycle Form),

2.For Each PDF File:

2.1. Extract the XML Data from the form,

2.2. Convert the XML String to XML Document,

2.3. Extract the single fields and repeating group of fields and update the Database,

2.4. Generate Key Values.

2.5. Send email Notification to the sender of the form, to confirm receiving the form and start initial processing.

Regards ...

Tarek.

My Product Information:
LiveCycle Designer, Windows
wdrspens
Registered: Jul 22 2008
Posts: 94
You do not say which database you are using, but I have recently had the same problem using Microsoft Access 2007 and solved it with relative ease. If you are using that database, or probably any database that will accept .xml files, I should be able to help.
Regards
David
tarekahf
Registered: May 1 2008
Posts: 91
Thank you David,

Actually my problem is not with the conversion from XML to Database, although if you tell me how you did that, it will be of great help to me.

I will tell you again to summarize:

1. How to use IAC (OLE Automation) in VB.NET to open a PDF File from a local folder, get the XML Data in a string variable, and pass it as a parameter to another program to update the Database,

2. If you could show me how to Update a Database from XML String to Add a new record, or Update existing record, or delete an existing record if it was not found in the XML Data.

For item 2 above, I simply convert the XML String to .NET XMLDoc Object, and use XMLDoc APIs to retrieve the Data Items (single and repeating elements) one at a time via a loop, and update/insert/delete as needed. Or, I convert the XML to Dataset, and do the same in a loop ...etc.

Your help will be greatly appreciated.

Tarek.
wdrspens
Registered: Jul 22 2008
Posts: 94
Hi Tarek

Your problem is much more complicated than my skills can aspire to reach.

Microsoft Access 2007 imports .xml files without the user having to do anything apart from remember to click in the "append" rather than "new" selection.

The solution I used was to import the data once to find out how it was imported, into how many tables with what data, and then to set a Primary Key in the primary table and in the LC Form, with the same key hidden or invisible in the LC Form in respect of all other tables imported, whether single or multiple rows, thus having the necessary relationships for the database.

That is not what you want and I am sorry I cannot help with your problem.

All the best

David