Skip navigation
Currently Being Moderated

Import XML data at load of PDF form

Apr 22, 2010 7:53 AM

Not sure that this is the correct forum, but it looks like a good place to start.....

 

This is my question:

 

At this moment we use an MS Excel file that runs a macro at startup that imports fielddata from an external xml-file. So, a user that opens the Excelfile will not have to fill in customer-data that is supplied by the xml-file. It is automaticly filled. For example Customer name, address, postcode etc.

 

Now, we have created a simular form in Adobe Livecycle, but we cannot get the xml-data to be imported just like the Excelfile does.


Is it possible, and how is it done, to open a pdf-form, import data from an external xml-file, all without user interaction?

 

Hope that my question is clear. Please advise

 
Replies
  • Currently Being Moderated
    Apr 22, 2010 8:09 AM   in reply to NL Erik G

    First you need to design your PDF form in LiveCycle/ Acrobat and bind the XML structure to each of the fields. Means when you import the data, the form needs to know which XML tag value to be displayed in which field.

     

    After the form is developed, you can use Acrobat's Import data menu item to import the XML file..

     

    Import Data in Adobe Acrobat.jpg

     

    Thanks

    Srini

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 23, 2010 8:02 AM   in reply to NL Erik G

    You have a method in host object that can import the data to the PDF form. You can call the method in the initialize event of any of the form controls.

     

    xfa.host.importData("<XML File name>", true);

     

    But this works with the certified forms only. You need to certify your form before you distribute to the users..

     

    Thanks

    Srini

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 26, 2010 12:52 PM   in reply to NL Erik G

    Erik,

       Check the below sample..

     

       https://acrobat.com/#d=iORvrl27geMudD0HrA7JBw

     

       Save the below XML as BookStore.xml in your local. After you open the form, Click on the Import Data button and select the XML file from your local.

     

    <?xml version="1.0" encoding="UTF-8"?>
    <bookstore>
    <book lang="eng">
       <title>Harry Potter</title>
       <price>29.99</price>
    </book>

    <book lang="sp">
       <title>Learning XML</title>
       <price>39.95</price>
    </book>

    </bookstore>

     

     

         This is the simplest you can do without going for the Certified form.

         Certified forms can be done by using Certificates from Adobe. You need to purchase them separately.

     

        If you omit the arguments in the importData()method, then you do not need to certify the documents. But the user needs to choose the XML file from their file system.

     

         xfa.host.importData();

     

    Thanks

    Srini

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 29, 2010 8:26 PM   in reply to NL Erik G

    Erik,

         I do not see that option available with the importData method..I will see if there is any alternative way..

     

    Thanks

    Srini

     
    |
    Mark as:
  • Currently Being Moderated
    May 3, 2010 7:03 PM   in reply to Srini Dhulipalla

    I have downloaded the file and did what you said but can not get the info to import.  Does this still work.

     
    |
    Mark as:
  • Currently Being Moderated
    May 5, 2010 12:30 PM   in reply to jtbgolfer2003

    Do you have this working or still need help.. If so, please explain what you are trying to achieve and what is not working..

     

    Thanks

    Srini

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 13, 2010 8:14 AM   in reply to NL Erik G

    I believe the difference is that you need to extend the form to allow people with reader to have additional permisions. You can do this

    either from reader extensions or from Acrobat itself (but there are limitations to using acrobat, eg how many times the

    form can be used)

     

    edit: i just noticed that this was mentioned before

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 21, 2012 6:33 AM   in reply to NL Erik G

    hi,

    I want to open the "Open File Dialog" using JavaScript to import xml data.

    I've tried with  "xfa.host.importData();" but the button does not work.

     

    There is another way to do that?

     

    Thanks,

     

    ChangoPlatense

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 6, 2012 4:31 AM   in reply to ChangoPlatense

    Hi Srini,

     

                   How to use this in Javascript for automate...

     

    Thanks in advance

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 21, 2012 12:34 AM   in reply to Srini Dhulipalla

    Hi, what kind of command is it? Can I use it in VBA? What reference i need?

    Thank you

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 14, 2014 8:00 AM   in reply to Srini Dhulipalla

    Dear Srini,

    we are using Excel 2010 to store patient database. We have now designed a PDF form in Adobe designer 7.0 on which we want to pull patient details like Name, Address & contact details from the excel 2010 file and populate the fields on entering the Patient ID. OS on one of my desktop is Windows7 &  another desktop with XP servicepack 3. Please help me in creating this link. By profession i am an Ophthalmologist hence dont have much idea about connecting databases.so will need detail explanation. let me know in detail how to create the ODBC connection. Thanks in advance.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (1)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points