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 or Acrobat Standard, 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 Pro/Std 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 (or Elements for that matter), on the other hand, aren’t privy to that functionality by default.

Side note: In Reader 7.0.5, there was a bug that resulted in Reader having the ability to import data into non-Reader-Extended (more on Reader Extensions below) forms. That bug was fixed in Reader 7.0.7 such that Reader can no longer, by default, import data into a PDF form.

The general rule is that PDF forms opened in Reader must be individually extended using Adobe LiveCycle Reader Extensions in order to enable the use of special hidden features such as Data Import, Digital Signatures, Local Save, Commenting and more. The only exception is if you own a licensed copy of Acrobat Pro 7.x which allows you to send a PDF out for review via email — which will enable Commenting capabilities in Reader for that PDF — or version 8.x in which you now have access to a new feature called “Enable Usage Rights in Adobe Reader“, available under the “Advanced“ menu. Using this new version 8.x command enables the Local Save and Digital Signature features in Reader for a particular PDF form. That said, before you start enabling all your forms, you should note that use of these Acrobat Pro features is subject to certain restrictions as detailed in your license agreement which you should be aware of.

Important: Local Save is not equivalent to Data Import. Local Save simply gives the user the ability to save a copy of a PDF form, along with any filled data, using the free Reader such that the form may be closed and re-opened at a later date in order to be completed.

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:

Version PDF Form With Reader Extensions With LiveCycle Forms
Reader no yes yes
Elements no yes yes
Standard yes yes yes
Professional yes yes yes

Updated: July 11, 2007

76 Responses to “Importing Data in Acrobat”

  1. Michael Joyce Says:

    What about using ADBC?

  2. Stefan Cameron Says:

    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.

  3. Lan Pho Says:

    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?

  4. Stefan Cameron Says:

    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>.

  5. Rikard Isoz Says:

    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

  6. Stefan Cameron Says:

    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.

  7. Sérgio Says:

    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

  8. Lala Says:

    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.

  9. Stefan Cameron Says:

    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.

  10. malik Says:

    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

  11. Stefan Cameron Says:

    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.

  12. Chris Maertz Says:

    Hello,

    I need to populate a drop-down list on a PDF form using the WSDL service. I can’t find any good information on how to bind the return data to the drop-down list, nor what I should use as a return type for the web method. Does anyone have some .NET code that show proper way to return the data. (Right now I’m returning XML as a String via a web method.) I can get the XML to show up in a form field, now I need to populate the drop-down list with the data.

    Thanks,

    Chris Maertz

  13. Stefan Cameron Says:

    How about modifying your WSDL to have calls that return individual values instead of one big call that returns all the info formatted in XML? That way you wouldn’t have to parse the XML in Designer.

    As far as binding the return data to the drop down list, you should be able to create a new data connection to your web service and then use the new Dynamic Properties feature in 7.1 to populate the drop down list automatically.

  14. Y Gautham Says:

    Hello,

    Im trying to retrieve data from MS-Access. While retrieving the table is not dynamically growing. Only one record is being fetched. Even if a new record is added with a button the data is duplicated. New data is not added. Can you help me with this?

    Thank you,
    Y.Gautham.

  15. Stefan Cameron Says:

    Y. Gautham,

    It sounds like you might not have placed the bound fields in a repeatable container (subform).

    Typically, you group your fields (bound to data nodes in a data connection) into a subform (let’s call it “DataSF”), bind the DataSF subform to the data connection itself (or a repeating section within the data), place the DataSF subform inside a flowed subform and then specify, using the Object palette’s Binding tab, that the DataSF subform should repeat for each data item.

    This would produce a form that would output all records from the database table to which your data connection is referring.

  16. Y. Gautham Says:

    Hi Stephen,

    Thanks for your reply.

    But unfortunately I am unscuccessful even after following your instructions.

    I have created a Data Connection to an Access Database. I placed 4 fields of it bound to the data connection in a subform. I placed the subform in a main subform with subform content property “flowed”.
    But when I go for PDF preview I could only see the first record from the table.

    A typical issue what I observed is when I am trying to bind the Data Connection to Subform I am not able to select DataConnection from the menu (shown when we click at the triangle beside Default Binding field in the Binding Property of the subform). I have entered “$record.DataConnection” manually in the field.

    Thanks for reading this patiently. Your response is heartfully appreciated.

  17. Stefan Cameron Says:

    Y. Gautham,

    I hope you’ll accept my appologies for not providing the “full answer” to your question in my first reply. I was under the impression that it was possible to load all records from an ODBC data connection much in the same way as one can for XML Schema (XML Data file) data connections. It seems I was mistaken, however, because the nature of ODBC data connections is to load a single record (single table row) at a time. You are therefore required (at this time) to write a script which iterates through the records using the first() and next() functions on the Data Connection object and for each record, use the DataSF’s Instance Manager (”_DataSF”) to insert instances populated with data from each record.

    Fortunately, most of the work is already done for you if you use the Initialize script from the Data List Box object found in the Library palette’s Custom tab. All you need to do is modify it a little in order to create instances of the DataSF subform.

    Since I figure the “full answer” was better explained in a blog post that everyone would notice, I wrote a little sample which details the steps to follow: “Displaying All Records from an ODBC Data Connection”:http://blogs.adobe.com/formbuilder/2006/10/displaying_all_records_odbc_dataconn.html

  18. Nathan Says:

    I hope that someone is able to help me. I have posted the same question on the forums at Adobe, so I will hopefully come up with an answer.

    I work for a registered charity in Manchester, at which we have recently redesigned our website. In order to generate more interest in job applications which we advertise, we have included online application forms. The XML data submitted is ok for me to read and understand, but I would like to know if there is a free, or very cheap way of importing the information the original PDF form without buying the full license for new Acrobat software, in turn making it easier for my colleagues to understand. We don’t mind using 3rd party plugins, or separate software, as long as they are free, or cheap.

    Many thanks

  19. Stefan Cameron Says:

    Nathan,

    In terms of Adobe solutions, the cheapest way to get you there would be to purchase one copy of Acrobat Standard. This would let you import the data you receive into the form and save it as one combined unit. The form and data could then be passed-around to those that need to process it.

    Otherwise, I would suggest writing a little JScript that uses the Microsoft XML Parser to parse the XML data and display it in legible form in a message box. Or you could write an XSL translation that formats the XML data into legible form and again use a little JScript to apply the XSLT to the XML and output a text file, for example. These solutions are free of cost and relatively simple to do if you’re knowledgeable in writing JScripts.

    I can provide pointers on my JScript suggestion if you’re interested. If you used the XSLT solution, you could process it on your system when you receive the data and only distribute the legible version of it.

  20. Atiq Says:

    Hi,

    I am working with insertInstance Object. But problem is my Designer 7.1 says its not a function. Can anyone help me out regarding this.

  21. Marleen Says:

    Can we populate one form with data from another form. I have one form that will take some user info and depending on user choice open up another form pre-filled with user info entered.

    We will be using Acrobat Pro.

    Thanks in advance for your help!!

  22. Stefan Cameron Says:

    Atiq,

    Unfortunately, the Instance Manager’s insertInstance method is only available when running your form in Acrobat 8.0 or later. This means that you can still use Designer 7.1 to design a form that uses the insertInstance method however you’ll need to preview or run the form within Acrobat or Reader 8.0 or later.

    I appologize for the typo in my post on the Instance Manager a few days ago. I’ve made the correction.

    If you need to target versions of Acrobat prior to 8.0, I would suggest you use a combination of the addInstance and moveInstance methods instead of insertInstance.

  23. Stefan Cameron Says:

    Marleen,

    Aside from using LiveCycle Workflow (which was designed for this sort of thing), I believe the only way you could achieve this is by connecting the forms to a central data repository (i.e. a database). The first form would set values in the database and cause the second form to be loaded (opened). The second form would then retrieve those saved values from the database and pre-fill the form as needed.

  24. Raul Says:

    Can I merge two .xml files into a dynamic pdf form created in Adobe Pro? I need to import from two different .xml files into a form. Any suggestions?

  25. Stefan Cameron Says:

    Raul,

    When you merge XML data into a form, you’re really importing XML data which respects a certain schema. That schema is either implied from the form’s object hierarchy (via containers and the fields they contain) or it’s done according to a data connection to a schema. The latter lets you use explicit bindings such that you can map specific data nodes to specific fields regardless of hierarchy.

    While XFA supports multiple data connections in a form, only one can be to a schema.

    So where does that leave you with importing two XML files? Fortunately, schemas can be combined — that is, you can have one schema import another schema and then create a data connection to the (combined) resulting schema. This way, you can import the entire set of data (both XML data files) as one data file.

    If you’re not using schemas, then you might also be able to simply combine the two XML data files into one.

  26. Aaron Says:

    Folks I would like some simple instructions on creating a wsdl web service and binding form fields to it so that the fields are populated at runtime..

    In the end I would like to be able to create have a webservice that a user can go to then select an identifier (name etc..) and get a read-only form with their data in it..

    this saves us from havign to manually create the pdf etc..

    thanks in advance !!

  27. Stefan Cameron Says:

    Aaron,

    Designer provides a way to create a data connection to a web service (WSDL). Such connections can execute request and response methods on web services. Once you define the data connection using the Data View palette, you’ll be presented with a data node tree. You can then drag these nodes onto a form to create fields that are bound either to the request or response method.

    You could therefore hide all the request fields and populate them automatically with the identifier that the user selected and execute the data connection in the form’s Initialize event to get the response fields populated with data when the form is opened.

    To execute the data connection when the form is loaded, you could simply insert a button on a form, specify it to be an Execute button and set it to execute the data connection to the WSDL (using the Execute tab in the Object palette) and then specify

    this.execEvent(”click”);

    as its Initialize event script. This would have the effect of executing the data connection, submitting the pre-populated data, receiving the response and populating the response fields with the response data.

  28. mj Says:

    In LiveCycle Designer, how do you set up a field in a form that performs the following: When you chose an item from a dropdown list you created it prefills another field with different information. For exemple you chose a city in one dropdown field and the corrosponding state prefills automatically in another field.

  29. Stefan Cameron Says:

    mj,

    This is typically done by scripting the Change event of the drop down list or list box object.

    In the Change event, which is fired every time the selection is about to change, you can then use the xfa.event.newText object to determine the text property of the item that the user has selected. Using the text, you can then determine the item’s value, if need be, by using the boundItem method of the object (”this” in JavaScript or “$” in FormCalc).

    For example, if the drop down list contained items with their text set to the city name and their value set to an ID of some sort that would then use to determine the associated state, you would do something like this in its Change event (in JavaScript here but FormCalc is fine as well):

    var sNewText = xfa.event.newText;
    var sNewValue = this.boundItem(sNewText);

    if (sNewValue == “CA”)
        StateField.rawValue = “California”;

  30. Bonni W. Says:

    Please do me a huge favor and check out the form I created at http://www.onemain.com/~bonster/february.pdf (it’s not spam, I swear, I just need help). I just got Adobe 7.0 Pro and am learning as I go.

    I have had two drivers send in their forms via email with an attachment in .xml format. However, when I go to “save target as” it saves it as .html instead. So when I try to import the file to a blank form, it won’t accept it.

    I have to retrieve this kind of stuff via my laptop, as the big computer is not as advanced. Therefore, I go wireless and connect to earthlink.net to retrieve my email through the browser.

    What am I missing here? Sorry, I’m a total novice when it comes to using Adobe Pro. Thanks in advance,

    BW

  31. Stefan Cameron Says:

    Bonni W.,

    It sounds to me like the problem lies with the way you retrieve the form’s XML data that was submitted via email, not with Acrobat.

    You might be able to fix this either by forcing the extension to be “XML” in the “Save Target As” dialog or by manually changing the extension on the file once you’ve saved it.

    If Earthlink.net is somehow wrapping the XML file attachment in an HTML file (or, even worse, encoding the XML data for display as HTML), you’ll need to contact them in order to figure-out how to properly retrieve the XML data file that’s attached to an email.

  32. Alex Says:

    Hello

    Have a project coming up next week.

    Engineers scan their drawings into PDF. They use it as template for different jobs. On these PDF forms instead of actual dimensions eng. use variables. For each job then they would have Excel file with all dimensions for corresponding var.

    The question is how to automate this process, so the application will take PDF, excel sheet and substitute variables on the PDF with actual values from excel.
    Any suggestions would be greatly appreciated!

    Thank you

  33. Harrison Says:

    Hello. I’m trying to create a price list that is linked to an Excel sheet of part numbers, descriptions, and prices.

    I’d like the fields in my PDF for these to be linked directly to a cell (which is a calculation) so that when the database changes, so will the PDF.

    I can’t seem to find a way to associate the PDF fields with the Excel fields.

    Any help would be appreciated. Thanks!

  34. Stefan Cameron Says:

    Alex,

    I would suggest you use the Microsoft Excel Driver for ODBC connections to define a DSN to the Excel spreadsheet. Then, in Designer, create a new ODBC data connection (using the Data View palette) to this DSN. Note that you’ll need to specify an SQL statement for the connection: I found a tutorial on creating ODBC connections to Excel spreadsheets which gives a sample SQL statement that you can use (see step #3).

    This will get data from the Excel spreadsheet into your form.

    A word of caution: Unless you know how to properly reference a column with spaces in its heading name (in row #1), make sure that none of your column header labels/names have spaces in them or you’ll have a lot of grief trying to get this to work.

    Please let me know how it works-out!

  35. Alex Says:

    Hi Stefan
    Thanks a lot for the response. I got an idea where to start.
    Still a little confuse though. Creating DSN to the Excel shouldn’t be a problem. But everything regarding Adobe is new for me. Not sure how do I take a scanned PDF document (drawing) and extract variables from there for substitution? I’m working with Adobe Professional 6.0.
    Anyway, thanks again, I’ll definitely let you know how it goes. I would have to start working on it within day or two.
    Alex

  36. Stefan Cameron Says:

    Harrison,

    I think you also need to use the Microsoft Excel Driver for ODBC connections in order to get live data from an Excel spreadsheet.

    Please see the comment I just posted here to Alex on Feb 12, 2007, 02:18 PM: It has a link and some tips about Excel ODBC connections.

  37. Stefan Cameron Says:

    Alex,

    If you’re using Acrobat Pro 6.0, then I presume you’re using Designer 6.0 as well?

    You might be able to use an image object (found in the Library palette’s Standard tab) to include your drawing as a background to the form. (Note that I’m not talking about an image field in this case since it’ll have undesired side-effects when used as the background for a form.)

    Once you have that done, you should be able to position text or numeric fields above the image (if they disappear behind it, just use the “Bring to Front” command in the Layout menu) and bind those fields to data nodes in your Excel ODBC data connection.

  38. Chris Q Says:

    End users are completing an online form that generates an excel spreadsheet. We are trying to take that data from the excel spreadsheet and map the data to an existing Adobe PDF form, automatically updating the PDF form so end users can save / print the form. Can this be done? What additional tools are needed? Thanks.

  39. Stefan Cameron Says:

    Chris Q,

    You should be able to import data from an Excel spreadsheet by using Microsoft’s Excel ODBC driver.

    See my response to another comment on this article which provides a little more information on how to do this, along with some links.

  40. chris Says:

    Hi. I am having some difficulty working out a solution to a work flow.

    I have a form that is filled out that will insert a db record or change a db record. The workflow is as such:

    1. Author fills in form and locks the form data and sends to manager for approval.
    2. Manager reviews form data. Accepts - db is updated with form data. Rejects the form goes back to the author to amend.

    Here is the issue. How can I get the author to unlock the form to amend the data - how does the form know it’s the author.

    I thought may I could use a digital signature.

    Is there anyway someone that has signed a document can “unsign it” thereby removing the field locks. I may also run into trouble updating the db via script once the form has been digitally signed.

    If you have any other approaches I sure would like to hear about them.

    The data signature seems interesting, but I don’t actually want to submit the data anyway - just have the user say the information is correct.

    This blog has been a life saver to me so thanks for all your time and effort.

    Chris

  41. Stefan Cameron Says:

    Chris,

    I’m delighted to hear that you find my blog useful!

    I don’t believe Digital Signatures will help you in this case. One of the principals behind Digital Signatures is that they must ensure “non-repudiation”, which means that an individual cannot deny a signature is theirs. If one could, it would essentially be the same as being able to remove one’s Digital Signature from a signed document (or signed data).

    In all honesty, what you’re wanting to achieve is really what the combination of Adobe’s LiveCycle Forms, Form Manager and Workflow was designed to do (and much more).

    Short of purchasing those products, there isn’t really anything that can do “proper” authentication the way you’re wanting to. There are certainly ways to build a basic form of authentication right into the form but it would only serve as a deterrent at best.

    For example, XFA supports password fields that mask their value. You could include two password fields on the form: The first one would be used by the author to set the password for that form and “lock” the fields while the second would be used to verify the password and “unlock” the fields.

    If there’s no value in the “initial” password field, then all fields are “unlocked” (i.e. writable) when the form is opened so that the author may enter values into the fields. Once the author is ready to submit the form to their manager, they enter a password and submit the form. (Note that the password is submitted in clear text.)

    When the manager opens the form, all fields become “locked” (that is, read-only) because there’s an initial password specified. If they disapprove of the form and send it back to the author, the author opens the form (which now has its fields locked, or set as read-only) and verifies the password in the second password field, which then unlocks the fields. (Note the second password field would be un-bound such that its value would not be transmitted with the data since it’s not necessary and you don’t get into a situation where the form is opened and the password is already confirmed…).

    When the manager finally approves the form, all the data — except for the initial password — gets submitted to the database.

    Makes sense? It’s a little difficult to explain in words — hopefully you understand what I’m trying to say.

  42. Dex Says:

    I am a form virgin creating a form in Adobe Designer. I have used HTML in the past but never Adobe so I thought I would give it a shot. I am the only technologically inclined person in my office and am wondering the best way to go about importing the data for viewing. If it was just me in the process I would just import it. Originally it will arrive by email into one box and be forwarded to someone else. Is there an easier way to do this without having to import to the original form to view the data? Can this be done server side and THEN emailed in the form? Perhaps a stupid question, but its the only way I know to explain it. Thanks!

  43. Jim Says:

    Hi Stefan,

    Do you know where I can find a sample PDF and sample web service to do import data from a web service? I failed to figure out how to make it work.

    Thanks

  44. Stefan Cameron Says:

    Dex,

    I’m glad to hear that you’re giving LiveCycle Designer a try!

    I think what you’re asking for is an alternative to form data being submitted/received as an XML Data File attached to an email. This is cumbersome because the recipient of the forwarded email must then know enough about Acrobat in order to import the XML Data into a blank copy of the form.

    The only way to get the data without having to import it into the form is to submit the form itself along with the data filled-in.

    You can do this in Designer 8.0 by using a regular submit button (use a button object from the Library palette and select “Submit” from the “Control Type” property on the Object palette’s Field tab) and specifying “PDF” in the “Submit As” property on the Object palette’s Submit tab.

    To submit the PDF to an email address, simply enter the following Submit

    mailto:email@address.com

    where “email@address.com” is the email address to which the PDF should be submitted.

    There’s one catch with this solution, unfortunately, and that’s the fact that by default, people using the Adobe Reader will still not be able to submit the PDF after filling the form (because this would technically be a way of saving the PDF which isn’t allowed in Reader). In order to get your submit button to work properly in Reader, you’ll have to extend your PDF form to enable usage rights in Adobe Reader. This will enable Reader to save data (and therefore submit the entire PDF) when your form is filled. You can extend your PDF form by using the “Enable Usage Rights in Adobe Reader” command under the Advanced menu in Acrobat Pro 8.0.

    The end-result will be that the complete PDF, including filled data, is submitted to the email address of your choice. This way, form data doesn’t have to be imported into a blank form, upon receipt, in order to be processed.

  45. Stefan Cameron Says:

    Jim,

    I was able to find a sample web service you can test with.

    It’s nothing complex: It provides a pair Request and Response methods which take information about an employee and return the same information back, respectively.

    First, create a new data connection to the web service and select the (one and only) “echoEmployee” Operation. That will produce a data connection with 3 items: “echoEmployee Request”, “echoEmployee Response” and “echoEmployeeBtn” in the Data View palette.

    To try this out quickly, simply drag the entire data connection item onto your form. This will automatically create the appropriate hierarchy of subforms and fields with the proper Import/Export Bindings (you can check them out on the Binding tab in the Object palette) along with a submit button which will execute the operation represented by the data connection.

    If you run the form in Acrobat, fill-in the top fields and click on the button, the information you filled-in will be submitted as a request to the web service’s “echoEmployee” operation and the response will automatically be displayed in the bottom fields.

  46. Kris Says:

    Stefan,

    I’ve designed an interactive PDF form using LiveCycle Designer that makes a web service call (with rights enabled using Adobe Reader Extensions). The web service invocation happens perfectly on the desktop Adobe Reader 8.0. However, the same doesn’t seem to work in a Pocket PC, with Adobe Reader for Pocket PC (PPC) 2002. Also, I’ve tried using FormCalc methods GET, POST, GOTOURL as well. None of these works at the PPC Adobe Reader. Even a servlet invocation on a HTTP button submit doesn’t work in a PPC.

    It would be great if you could let me know if these are really known limitations with PPC. Are there any work-arounds to solve this problem?

    Thanks for your time on this.
    Kris.

  47. Stefan Cameron Says:

    Kris,

    I’m sorry for the delay. I’m working on finding the answer to your questions but this one’s going to take a little more time than usual.

  48. Stefan Cameron Says:

    Kris,

    Just when I thought it would take a little more time to get answers, I received confirmation that the Adobe Reader for Pocket PC 2002 only has very basic form support and as such web service data connections (and most likely any kind of data connection) aren’t supported at this time.

  49. Kris Says:

    Stefan,

    Thanks for the prompt response. I appreciate your efforts in this regard.

    Kris.

  50. Siddhartha Jain Says:

    Hi Stefan,
    I followed your excellant blogs on retrieving All records from an ODBC data source(SQL Server) and the one on Connecting a form to a Database and was able to create an Interactive form which displays all the records on the top in a table and in the bottom, the records are available, for editing one at a time,using the database navigation controls .This form was working fine when used with Adobe Acrobat Professional.
    I tried to use this form in SAP’s Web Dynpro Java Application, which uses the Adobe Document Services to generate the PDF form and enables Reader Rights so that the form can be used via Adobe reader as well.
    I render the form in the web application, after downloading, i open the form in Adobe Reader 7.0 and on the client PC i have the DSN created for the ODBC connection.
    I use two data connections, one for navigation of the database records and another one to load the records.The data binding for the connection works fine and i am able to navigate and edit the records, but the table showing all the records is not being displayed.
    I tried to debug this by using the xfa.host.MessageBox and found that the records are being fetched and the instance manager creates the instances with the data,but the same are not being rendered in the PDF.
    I am unable to understand the problem.
    Can you please guide or provide some help on this.

    Thanks,
    Regards,
    Siddhartha

  51. Stefan Cameron Says:

    Siddhartha,

    My first guess at the cause of the problem is that you’re attempting to use tables in Acrobat 7.0. Tables weren’t supported until Acrobat 7.0.5 (and authoring them wasn’t supported until Designer 7.1) which would explain why you don’t see the table.

    Tables are essentially subforms, though, so you could easily replicate the table behavior using simple subforms and use the “Subform Role” property on the Accessibility palette to specify the role that each subform plays in the table (to ensure that screen readers treat the subform structure as a table without actually using a table object).

    To create a basic table, you would need an outer subform with a role of “table” (set in the Accessibility palette) and a content type of “flowed” (set in the Subform tab of the Object palette) but don’t make it flowed until you insert some subforms into it to define the table rows. You would then give those subforms the correct role for a header row, body row or footer row. Finally, you would add some fields to the various rows (for the cells) and you could also make each row subform flowed to get a nice tight fit.

  52. Stefan BG Says:

    Hello Mr. Cameron, Hi to everybody,

    I am struggling lately with PDFs and document personalization, which easily could be done with PDF FORMS. The problem I am trying to solve is a part of BPM+CRM concept, and is as follows: I would like to achieve independence from BPM in setting layouts of documents(forms), since we are very picky about them. Hence, Iam trying to make possible designing structure and layout of a form and then uploading it to a server. Afterwards this form would be filled by the server, flattened and given to be download by a user.

    Would anybody tell me if for the part of filling and flattening of PDF FORM I shall need a special software or plug-in under Linux, could it be done by directly writing in the code of the PDF itself.

    So far We ve been using LaTeX, which is basically disgusting way.

    10x

  53. Stefan Cameron Says:

    Stefan BG,

    I’m afraid this is a little beyond me. The only part that sounds familiar to me is the following

    …uploading it to a server. Afterwards this form would be filled by the server, flattened and given to be download by a user

    which basically describes what LiveCycle Forms ES would do for you.

    Hopefully someone more knowledgeable will chime-in…

  54. Leticia Says:

    Stefan, thank you for this blog, it’s a good place to go when the help/documentation does not cover it.

    I can’t tell if this article is saying that I would need another LiveCycle product to accomplish the follwing so I’ll just ask you. I have a form that I am having a product supplier fill out in order to add their product to our catalog. Most of their input is text based and simple to set up. However, the form then gets looked over by a manager and the product gets assigned a number of categories before the data gets submitted to a database. The categories do not change often, but it is a long list of categories (Level 1 is 56, level 2 is about 10 each) .

    I have two problems.

    1) How do I get the list of categories in to drop down menus in the form. I can’t use a database connection and the list is too long to type in myself. This is because I don’t want it to produce an error for the supplier since I can’t connect the form to the DB at the supplier’s end, and they are not making the category selections anyway. If I provide an xml file as the data source, it sounds as though Reader won’t import the data and the supplier will get an error anyway. Is there a way to load a long list of data into the form to pre-populate it?

    2) How do I make the subcategory drop downs to depend on the category selection. for example if the category selected is Cat the second drop down options should be Collars, Food, and Toys.

    Cat
    Collars
    Food
    Toys
    Dog
    Collars
    Food
    Leashes
    Toys

    Thanks for your help Stefan!

  55. Bade I. Says:

    Hello Stefan,

    Dont know if I need to state this:
    System: Linux system running apache
    Database: MySql
    language: PHP5

    I have this issue with what I am currently working on. I have a pdf document that I am trying to populate with data. on the page I have form fields (all textboxes). There will be the need to have multiple pages with the same configuration of form fields (so to achieve this I went ahead and made a page template which I am hoping to duplicate with javascript). It turns out I can populate the form elements with fdf generated with php (I can also figure out how many copies of the pdf template that I require from the php page). It becomes difficult when I am trying to populate multiple pages with the data using fdf. So I think I am currently presented with 2 challenges:

    1. When I call the pdf page from the php page (this is done after the fdf has been created), I can call the pdf page with querystrings through which I can pass the number of additional pdf pages that I require. Then on the pdf side of things, I can, through javascript, harvest the querystring and figure out how many additional pdf pages to create; then I will just make duplicates of the template page (i.e. using the combination of getTemplate and .spawn functions).

    PROBLEM WITH 1: The only places I can put the javascript occur after the page is loaded (I think). It will be nice if there is a place where I can place the javascript to create multiple pages before the pdf document calls the event that populates the form fields with the variables from the fdf.

    NOTE: I have everything working except the creating multiple pages before fdf variable load event

    2. Just maybe I am thinking about this whole thing (Procedure 1 above that is) wrong. What should be my line of action in solving my issue

    PROBLEM 2 summary: I have a pdf page I have created with Acrobat 8 Pro that contains form fields. Based on the data I intend to populate the pdf file with. I will require several duplicates of that first page to populate with the additional data. I cannot connect to a database and pull records for security reasons, so I will have to pass all the data to the pdf file somehow.

  56. Stefan Cameron Says:

    Leticia,

    Unfortunately, there’s no way of importing a list of items into a drop down list or list box in Designer. The only way to somewhat cut down on your work load would be to try to use a script to make the job easier.

    For instance, if your database could produce a comma-delimited string of the primary list items, you could then paste that string into the Script Editor as a string variable. If you did this in the drop down list’s Initialize event in JavaScript, you could then use the String object’s “split” method to automatically produce an array of string values based on the commas. Once you have an array, you could easily loop through it in order to populate the drop down list. This would give you a drop down list populated when the form is initialized without having to manually enter all the items into the list using the Object palette which would undoubtedly be very tedious work in your case.

    For the secondary lists, I would use the same concept but put them in a script object. You could define a function that initializes the secondary lists into arrays and call it from the primary drop down list’s Initialize event so that this happens on form initialization.

    Once the form is initialized and you have the primary drop down list populated and the secondary lists translated into array objects in a script object, you would then add script to the primary drop down list’s Change event and key on “xfa.event.newText” which will contain the item text data that the user selected (the name of the primary category). You would then determine which secondary list (array in the script object) should be used, populate a secondary drop down list using that array and, finally, make that secondary drop down list visible.

    While this may sound very complex, there just isn’t a nice way to handle lists with two+ levels in XFA nor in Designer.

  57. Stefan Cameron Says:

    Bade I.,

    It sounds like you’re trying to achieve all these things using AcroForms which isn’t my specialty. You could try posting your question to AcrobatUsers.com’s “Ask An Expert” Forum (it’s free) to see if one of the PDF experts would be able to help you out. Good luck and let me know if there are any Designer- or XFA(PDF)-related questions I can answer for you.

  58. Meng Says:

    Hi Stefan,

    Is it possible to add attachment to Adobe LiveCycle Forms?
    I am currently making an input data form and I plan to make it be able to give users a possibility to attach any external files if needs arise.
    Example if an user would like to attach a PowerPoint file with graphics as additional information for his/her data input.

    Thanks in advance.

  59. Leticia Says:

    Stefan,

    Thanks for the reply. It sounds like I have some work to do in order to populate my lists. If you could answer a couple of questions maybe there is anther answer.

    If I have the form connected to the DB on the manager’s end (using Acrobat Std ) and they select the from the lists that pull from the DB. Can the form be sent off to the form-filler with the selected data? Will the form filler get an error message because of the DB connection?

    Thanks for reply.

  60. Stefan Cameron Says:

    Meng,

    While it’s possible to add attachments to XFA-based PDF forms which you author in LiveCycle Designer, you can only do it using Acrobat after you’ve saved the form in Designer and beware that attachments are not supported on these types of PDF files and will be lost if you ever re-open the PDF in Designer and re-save your form.

    You would be best to create another PDF (which isn’t based on a form) which can act as the container for other files — a PDF Package, if you’re using the latest version of Acrobat Professional. You would then add your PDF form and its pertaining files as attachments to that PDF (or add them as items in the PDF Package).

  61. Stefan Cameron Says:

    Leticia,

    If the form is programmed such that it queries the database connection when it gets loaded and the recipient doesn’t have a DSN setup to point to the database, then yes, the recipient will get an error message about the connection not existing.

    In order to send the form to the recipient with the selected data, the manager would first have to save the PDF, after making the appropriate selection to get the data from the database, when the send the form to the recipient. Alternatively, you could provide a submit button on the form which submits the data and/or the entire PDF with data. The recipient would then either open the blank form and import the data that the manager sent them or they would receive a copy of the form with data already saved in it.

  62. temp25 Says:

    I’m trying to create the following process (using Acrobat Pro 7.0 on mac): (1) The user completes an online form and clicks the submit button. (2) The data is forwarded to me via email (without the user opening an email client). (3) I populate that data into the original pdf (on my computer) to be printed. I’ve been trying forever to get a pdf form to allow online submission. I’m to the point where the form can successfully be submitted as html but I can’t get it to submit using fdf. I’d like the user to submit data that is received by email to be repopulated on my computer so that I can print the pdf as it appeared on their screen when it was submitted.

    The problem is that the html information that’s emailed doesn’t allow me to feed it back into the pdf file and selecting fdf as the submission method (for the submit button) generates errors.

    The form is already created and the submission (as HTML) submits properly (but doesn’t meet my needs).

    I obviously don’t know much about scripts and just need something simple. I don’t need for the server to send any information to the user; I just need the fdf data to come back to me so that I can import it back into a .pdf–all generated simply by the user clicking the submit button.

    Any help? Is there a simple way to do this without a sophisticated knowledge of scripts?

  63. Stefan Cameron Says:

    temp25,

    Is there a reason why you need the data to come back as FDF? It sounds like this would be easily accomplished by having the data submitted as XML via email. Using Acrobat Standard or Pro on the receiving end, you can easily import the data back into the PDF and print it just as it was filled on the user’s system.

    When you use an email submit button, the submit data format is XML by default. When you use a regular button and turn it into a submit button, you need to specify “XML Data” in the “Submit As” property on the button’s Submit tab.

  64. temp25 Says:

    Stefan:

    Thanks for the response.

    I don’t have the option to use XML. The available options are: FDF, HTML, XFDF, and PDF. I’ve tried HTML (doesn’t work out), PDF (requires submission as an attachment via separate email client and doesn’t allow data to be “stripped” later into a database), and FDF (can’t get it to work without some new type of script).

    I’m using Acrobat Pro 7 on Mac OS X.

    From research, I’d thought FDF to be the best way to go but I’m open to anything that will get the job done. I’ve now invested a total of about three weeks into searching for a solution–and I’m still looking. Any help is appreciated.

  65. Charlie Says:

    Stefan
    Nice forum. Glad to see you still answer questions after a year of your original post. I have Adobe Acrobat 8 Professional and I am looking for a way to open a form and import data at the same time with Adobe Reader. I followed your instructions in the paragraph that starts with “The general rule” and went to the Advanced menu and selected Enable Usage Rights in Adobe Reader. I noticed the form size changed after I saved it and selected this option again to make sure and it said the form was already enabled. I opened the form in Adobe Reader but don’t see any menu for importing data. You said this was special hidden features, but how do you access it. The other thing I would like to do is have the form automatically load the data when it is opened (in Reader). Is there a way to do this from the command line? I don’t want to add any com add-ins, dll’s etc. because I’ don’t know for sure the location on each user’s machine.

  66. Stefan Cameron Says:

    temp25,

    Ah, you’re using Acrobat Pro only. I was assuming you were using Designer, which is why I suggested you have the data submitted in XML format. Since you’re using Acrobat on the Mac OS, you won’t have the option of using LiveCycle Designer since it’s only available on the Windows platform (and only comes with Acrobat Pro for Windows).

    At this point, I’m afraid I can’t offer much more direction. I only have Acrobat Pro 8.1 on my Mac as a reference point and I’m not familiar with any previous releases. I would suggest you take your question to the Acrobat Forums and see if someone there could answer your question.

  67. temp25 Says:

    Stefan:

    I seem to be running out of options with Acrobat 7 Pro on Mac and a UNIX server.

    Would I be able to get the job done the way I’d like if I upgraded to 8.1?

    I posted on the Forums (and a few other places) a few weeks ago as well; no luck there yet.

    Thanks again for your responses.

  68. Stefan Cameron Says:

    Charlie,

    Thanks. I’ve tried my best to answer every question that’s been asked on my blog.

    Unfortunately, I think you missed the “Important Note” that follows that paragraph which explains that what “Enable Usage Rights in Reader” does is simply enable “local save” which lets the user save their form with their data in Reader in order to re-open the form with the data at a later time. It does not actually enable data import. This means that without Reader-Extending your PDF form using LiveCycle Reader Extensions (or without serving the form out to the browser using LiveCycle Forms), you cannot import data into a PDF form loaded in Reader.

    If you were able to extend your form or use LC Forms to serve it out, then you would simply create a data connection and cause that data connection to be executed when the form is opened. If the data connection is to a schema and you’re importing XML data, then this usually gets executed when the form is opened automatically. For ODBC and web service data connections, you usually have to open or execute, respectively, the data connection for the data import to occur when the form is initialized (using the Initialize event).

  69. Stefan Cameron Says:

    temp25,

    Unfortunately, I really can’t say if Acrobat 8.1 would make things better or not.

    Another place to try posting your question is to the ask an expert tool on the Acrobat User Community site. Someone there might know the answer.

  70. Kumar Says:

    Stefan:

    First of all I am thankful to you to have published the article “displaying all records from an ODBC Data connection”. I understand the MOVIESF addInstance does the job of publishing all records of the ODBC data connection. The example works fine as is in my Adobe LC designer 8.0

    however I have a modified requirements of this issue. I have an access DB mapped to the PDF through LC designer where I need to show the master-detail ( header-detail) relationship on the form data ( more for reporting purpose - so no button or list or combo box will be used for the master text field controls). SO i planned to use your solution and created another subform ( header subform with header fileds of the 1 to n relationship of data) into the sample form you had created, by keeping the “all records subform” as the detail. “all records subform” would not even move from the top most position in the hierarchy.

    I am trying to combine both your solutions on - 1. all records solution and 2. selecting specific database records. My logic was to load teh detail based on the two data connections I have to ACCESS DB; On initialize of the header subform to give the data items that will form the where clause of the modified query to be run on the second data connection.

    Man! only you can help - no sample applications exist for this requirement anywhere and I am new to LC deisgner.

  71. Kumar Says:

    What I mean by Header-detail is an example of a PURCHASE ORDER; order no; order date; bill to address are all header items; order no is the primary key of that table The details table will have part no, part description, number of units, and other calcuatable columns for every order no. in teh header. There will be multiple rows to be shown at once on the “details” subform for every record of PO Number in the Header Subform. I spent many hours playing with both samples you have given; ON preview of the PDF, if Header data comes then the detail is not shown on the form and viceversa. Please help

  72. Stefan Cameron Says:

    Kumar,

    As I understand it, you have two tables: The first is the “header details” which includes the order number, order date and billing address. The second is an “order details” table which includes the order number, part number, part description, part quantity and other stuff. Your form has a data connection to each table.

    You say you want to show the header details for an order at the top of the form and then the order details in the form’s body but there will be no button, list or combo box used for the header details. That’s where I get confused: What is going to select an order to be viewed? Is that coming from yet a third table?

    So far, this scenario sounds very much like my tutorial on selecting specific database records but I don’t understand how the order is selected so that it’s details can be displayed.

  73. carol goslin Says:

    I’m tasked with creating a form (I am doing this in Professional 7.0 LC Designer. Placing the form then on the web for users (who are outside our network) to complete and email back to me. Couple issues with this: 1. Users have various versions of Acrobat and many users want to complete and save the completed form before hitting the email button.

    Issue 2: I need to find a way to take all these individual files being received via email, and import them into one microsoft access database table. So, basically one form equals one record in the table.

    How do I begin? At first I made a connection to my database, only to realize that won’t work as the users encounter errors because they do not have access to the database.

    Can you plese email me some suggestions or starter points?

    Thanks,
    Carol

  74. Stefan Cameron Says:

    carol goslin,

    The first thing to consider is whether the free Adobe Reader will be used to fill the form. If that’s the case, the only thing Reader can do (without Reader-Extending the PDF form to enable special features in Reader like “local save”) is submit XML data via email (using an email submit button) or via HTTP (using an HTTP submit button).

    At this point, I believe there are two possibilities:

    The first is receiving the data via email. In that case, you’ll receive XML data files. Acrobat Pro 7 may have a feature that lets you compile those XML data files into something meaningful, I’m not certain. Look under options for “distributing forms” in the help topics. If there is, it will likely generate an Excel spreadsheet containing all the data, one record per row. You would then have to figure-out a way to import that data into your Access database. I’m sure Access has a way to import data from an Excel spreadsheet into a table.

    The second is to receive the data via HTTP. You could write a simple PHP page to which the form would post the data. In the PHP code, you would get the posted data via the $_REQUEST global variable. You could then connect to your database using PHP and insert the data into the correct table in your database right away (not manual processing needed). Of course this option requires the user to be connected at the point when they submit the form.

  75. Singh Says:

    Stefan:
    We are thinking of generating multiple ‘pre-populated’ forms - send them out via email - get the data back into our DB. The problem I am facing is in the first leg of this process.
    We need to create multiple forms each one populated with one-record from the DB. So I am thinking that we need a process outside of an individual form and loop through all the records we retrieve from the DB and generate one form for each records.

    Any help would be really appreciated!

  76. Stefan Cameron Says:

    Singh,

    This is the sort of thing you would use other LiveCycle ES services to do. For example, you would create a workflow, using the Workflow Designer, that would have a loop that would iterate while there are records to be processed and for each record, it would generate an interim XML data file that would then be merged into an instance of the form. That form would then automatically be emailed to the appropriate recipients.

Leave a Reply

Alternate Help: Unfortunately, I am not always able to keep track of older posts. Please feel free to continue discussions here or seek help at an Adobe Forum: Designer/Acrobat, Designer ES, Designer (v6-v8), Acrobat, Reader.

If you're including scripts: To make sure your script and comment are properly interpreted, please make sure you replace any less-than ("<") characters with their character code equivalent: "&lt;" (without the quotes). Otherwise, your script and comment will inadvertently be cut short. Thank you!