« Tracking Mouse Clicks | Main | Invalid Flashing Fields 2.0 »

Importing Data in Acrobat

Data is central to every form. Some forms simply collect data while others use pre-collected data to do various things to forms, such as pre-populate names, phone numbers, addresses, affect the layout of a form or various other things.

Using pre-collected data to affect a form as described above involves importing data into a form via the host application (assuming a server isn’t part of the picture). This time around, I want to talk specifically about importing data using Acrobat.

As you all know, Adobe distributes the Reader application for free. Because of this, you can save the forms you design in Designer as PDF and anyone with the free Reader application can fill your form and submit its data electronically.

The catch is when your PDF form requires data to be imported. Unless the host application is Acrobat Professional, a regular PDF form cannot import data — no matter if it comes from an XML Data file or from a data connection to an ODBC or WSDL data source. Acrobat Professional comes with all the tools you need to import data into a form and permits data to be automatically imported via an ODBC or WSDL connection. PDF forms opened in Reader, on the other hand, aren’t privy to that functionality by default — that is, Reader 7.0.7+ (the latest version is 7.0.8) doesn’t allow data import by default.

In Reader 7.0.5, there was a bug that resulted in Reader having the ability to import data into forms. Unfortunately (well, that’s my opinion), that bug was fixed in Reader 7.0.7 such that Reader can no longer, by default, import data into a PDF form.

As of Reader 7.0.7, PDF forms opened in Reader must be individually extended, using Adobe LiveCycle Reader Extensions, to allow the use of “hidden” functionality in Reader (such as Data Import or Commenting).

Another option is to use Adobe LiveCycle Forms to deploy your forms. Using this server product, you can pre-populate forms with data on the server prior to deploying them to the client application (on the user’s system). Using this option, you don’t need to reader-extend a PDF form which imports data because the data is imported and merged into the PDF form on the server and then deployed to the client application (any version of Acrobat/Reader on the user’s system), which, in turn, doesn’t need to import any data.

To summarize, here’s a little table that illustrates the conditions under which you can import data into a PDF form in Acrobat:

VersionPDF FormWith Reader ExtensionsWith LiveCycle Forms
Readerno yesyes
Proyesyesyes

Comments

What about using ADBC?

Michael,

Thanks for pointing-out the use of ADBC for importing data.

ADBC is specific to Acrobat Forms as opposed to XFA Forms. In this article, I was trying to address importing data in Acrobat within an XFA Form (saved as a PDF). ADBC isn't an option in that case.

Ok, I am still not sure how to import data. What is the structure of data file with either tab or comma delimited file needs to look like to be able to import? Is there an automated way to populate the form with 50 names?

Lan,

When importing data from a file into Acrobat, the data must be in an XML format.

If your form is to consume the data that another application created and this data is comma-delimited, you would then have to write an XSL Transformation that, when applied to the data via a data connection created in your XFA form, would transform the comma-delimited data into an XML format that can be consumed by the form's data model.

For instance, you're talking about populating a form with 50 names. Now I there are two obvious possibilities here: You either have 50 fields which each should get a name or you have a list field (such as a list box or a drop down list) and you would like the names to be automatically loaded into the list when the data is imported into the form in Acrobat.

I'll assume you're talking about the latter option of populating a list field. This means that you data must have a repeating data node where each occurrence has a different value (a different name). This way, you can use the Dynamic Properties feature to create the kind of binding you'll need to have the list field automatically populated with all the names when the data is imported into your form:

<data>
<name>Fred</name>
<name>Wilma</name>
<name>Barney</name>
<name>Betty</name>
</data>
In this sample data, the repeating data node is <name>.

Hi Stefan,

We have been thinking of building a web app using LifeCycle forms and asp.net. Can you give some hints on the best way to prepopulate data on the server side, as well as extract data when client post data.

Best regards,

Rikard

Rikard,

That sounds like an interesting project: LiveCycle and ASP.NET.

As far as pre-populating a form with data, there are a few ways you can do that:


  1. You could have a server-side process generate data files that could then be merged into various forms using LiveCycle Forms in order to serve them out to the client application (e.g. Acrobat or a browser using HTML).

  2. You could create a data base and have your forms connect to it using an ODBC data connection.

  3. You could create an ASP.NET web service and have your forms connect to it using a WSDL data connection.


I believe importing the data via an ASP.NET web service is your best option however, regardless of what you decide, you'll unfortunately be faced with the required purchase of at least one other LiveCycle product (if you haven't already purchased one of them): LiceCycle Reader Extensions (to enable Acrobat Reader to import data from an ODBC or WSDL data connection -- unless you know users will always be using Acrobat Pro in which case you wouldn't need Reader Extensions) or LiveCycle Forms (to import the data on the server and send the form, along with the data, in a single package to the client application).

As far as extracting data submitted via a form, I strongly suggest you have a look at my colleague Steve Tibbett's blog: SteveX. He has a few great articles on data submission via a LiveCycle form.

Hi,

I would just like to add some comments to this discussion.

1 - To merge that with a pdf using, for instance, asp, one could use XFD or a XDP file (the latter one only with the data part). This file could be created on server side, and be given to the client. Because this files can point to a pdf file, the client would open and merge the data onto the pdf file.

2 - ADBC is just for Professional, not for Reader... at least I think so.

Regards,

Sérgio

I know there is a really easy answer to this, but, I need your help!

I am the database administrator for my state. The state is still using Microsoft Access. We are now creating a static form using Adobe Professional. In the form, my boss wants me to link the database tables from Microsoft Access where when the processing assistants enter the info on the form, it automatically saves in the Microsoft Database. Is this possible. I know I can use OLEDB but what is the 1st step to get started.

Lala,

In your comment, you said you "are now creating a static form using Adobe Professional."

Before I go any further, I just want to make sure you're using the Adobe Designer to design this form. This means you probably opened Acrobat Pro, went to the "Advanced | Form | Create New Form..." menu item and opted to create a new form in Adobe Designer.

Is that correct?

If so, then we can talk about creating a data connection to an ODBC data source and then have fields on your form bind to the nodes in the data connection in order to update data in the database in real time.

Hello there,

I am asking the same question about Microsoft Access and Adobe Designer and how to connect them to drop the fields from the table schema into the Designer.

Greetings

malik,

Please check-out the article I just posted on Connecting a Form to a Database. Hopefully this will answer your questions as well as Lala's.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)