Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session

automerge on form load

Avatar

Former Community Member
Hi--



I'm binding data to an XML file that's dynamically generated and want the data to automatically fill in the form when the form's loaded.



All is great in Designer preview, but when I load the form manually, it's blank.



What am I doing wrong?



Thanks!



:grimey
5 Replies

Avatar

Level 9
You can do this by having some Javascript that loads the xml file.

From memory, that's something like: xfa.host.importData("");

This will only work in Acrobat, or in Reader if your form is Reader-extended.

howard

http:/www.avoka.com

Avatar

Former Community Member
I have tried to import the XML data on page's initialize event by

xfa.host.importData("a.xml") but nothing happens. Do you mean another way?

Thank you.

Asiye

Avatar

Level 9
You can't import a specific XML file - that is regarded as a security breach. You can only import "", which will prompt the user to import the file.

Technically, you can actually import "a.xml", but you will need to install some privileged code onto each user's machine.



What are you trying to achieve?



Howard

http://www.avoka.com

Avatar

Former Community Member
Related question: I'd like to merge a pdf form with xml data on the server side, preferably in PHP but I'm flexible. I have a PDF that I've loaded into Acrobat Pro 9 and using Forms > Manage Form Data > Import Data, I can load xml from an XDP file that was created by initially exporting the form data, making a copy, and changing some of the values. That works flawlessly and populates all of my form fields. Now I nee dto do it programmatically on the server side, save as a new PDF file with these fields pre-filled, and redirect the user (using header(Content-Type: ???); echo $content;) to the new file. I've seen lots of examples using FDF and XFDF but I am guessing these are obsolete/deprecated and I can't get them to work in my current browser/acrobat reader. What is the current "best practice" way of doing server-side merging of xml data with a PDF form?

Avatar

Former Community Member
There is a server product called Forms in the LiveCycle family that does this for you.