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

Populating XML data into a PDF form

bgeary
Registered: May 3 2006
Posts: 11

I have created XML output from my SQL database and experimented with LiveCycle Designer. I've successfully populated the XML data into the form.

Populating the data is a bit of a pain to accomplish manually. Is there a way to automate the process? I don't have any Javascript abilities, so I'm hoping there's a built-in feature.

I have the ability to deposit the xml data into the same directory where the PDF form will reside and can use a consistent naming convention to simplify the process.

Thanks in advance.

Bill

Bill Geary

scottsheck
Registered: May 3 2007
Posts: 138
Can you elaborate? The first sentence says you are able to populate the form, but the 2nd sentence says you can't. How are you poulating it (in your first sentence)?
bgeary
Registered: May 3 2006
Posts: 11
Sorry for the confusion. I have been successful in creating the XML data file. To populate the form, I have to click (In Acrobat 8) Forms, then Manage Forms Data, then Import Data, then specify XML, then drill to the location of the file (which I store in the same directory, but have to navigate to it from the default location of 'My Documents' nonetheless).

I would love to have a button that would run a macro to accomplish all that.

Bill Geary

scottsheck
Registered: May 3 2007
Posts: 138
I see now. Yes, you could add a single button which runs the following javascript. I use it all the time.

xfa.host.importData("mydata.xml")

I've only used this in Acrobat 8. If you need to know the format of the XML file, then you could call exportData(), or it's most likely the same format as your XML file you are able import from the menu.
bgeary
Registered: May 3 2006
Posts: 11
Scott:

I've been fumbling around trying to get the button to work. You indicated that you do this all the time... Would you mind emailing me an example that I could examine? I could copy your technique that way. I would be most appreciative.

Thanks in advance!
Bill Geary
bill [at] repservices [dot] com

Bill Geary

scottsheck
Registered: May 3 2007
Posts: 138
What version of Reader are you trying to run this Importdata command in. I'm using reader 8.0. Also, I forgot to mention that you have to certify your document ion reader before it will work, so sending you an example is only part of the solution.

i haven't tried it in other versions, but it defaintely works in Reader 8.
bgeary
Registered: May 3 2006
Posts: 11
I'm actually trying to populate the form in Acrobat 8.0. I haven't gotten to the point of trying it in Reader.

What do you mean by 'certify your document ion reader?'

I'm creating my forms in Adobe LiveCycle Designer, if that clarifys anything. I'm assuming I should be able to open your PDF in LiveCycle and see how you're attaching your javasript to the button. Would you mind letting me see one of your forms?

Bill

Bill Geary

scottsheck
Registered: May 3 2007
Posts: 138
sorry, it looks like I was really using Acrobat the whole time, not Reader. I've tried in Reader and can't get the importData to work.
bgeary
Registered: May 3 2006
Posts: 11
That makes sense, if you think about it. The average end-user wouldn't have the technical capability to structure the XML data for import. It's more appropriate as an internal application.

So - would you mind sharing a form where you've used the technique? I am on a deadline to get the form working and am currently stumped. I would be most grateful. My direct email is bill [at] repservices [dot] comThanks in advance!

Bill Geary

scottsheck
Registered: May 3 2007
Posts: 138
i just sent you an example. like I mentioned, the example just a call to one line, importData(), so it won't really tell you anymore that what's explained above.

Also, the average user could use the importData command. They way they would know how to structure the XML would be to export the data either with the exportData() function, or by the menu export command in acrobat.
baystgirl
Registered: Jun 9 2007
Posts: 1
Hi guys,

I'm pretty new to using acrobat's forms functionality and would really appreciate your help with something I'm working on for a new role I'm involved with. Basically I receive a data file usually in excel format containing information for a new account application form with about 20 different fields. Since I'm pretty advanced with excel I can alter this data to another format like XML (which I have never used before) if needed. Basically there's a form that I need to populate with this information and the amazing thing about this form is the info then gets carried over and used throughout the pdf. I read the previous posts and would be very grateful if someone could walk me through in very basic terms how to go about doing this.

Also, is there an automated way to save a number of forms using the info from a specific field (i.e. first and last name =JohnSmith.pdf into a certain file folder)?

My email is baystgirl [at] gmail [dot] com if someone could send me some examples.Thanks for your help!
Prof-KOS
Registered: Dec 19 2008
Posts: 4
Hi everyone,

I have a project that I'm working on that is a little different from the questions asked prior. I can't seem to find an answer. The company I work for asked me to create a pdf quote form for our sales team to use. I built the form in Acrobat 9 and all the form fields are working great, even the basic scripting to make it easier to use.

My real problem is that I'd like to make the form better by having it populate the technical data fields of the product after the Part Number is entered in the field. I have an Excel file that has all the relevant data in it (over 2000 Part Numbers). I don't know where to start. What is the easiest way to do this. Should I use LiveCycle Designer, XML, JavaScript, all of the above? If anyone can point me in the right direction I would be very grateful.
juluri638
Registered: Aug 10 2009
Posts: 1
Hi..

I have a similar problem.. I have a single pdf form, and I have multiple data files in the form of xml. Can I put in a macro which will load the data in for me, based on an input.. The input would be something like an employee code, which would be the name of the file too.