Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

automerge on form load

Not applicable
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
HowardTreisman
Level 9
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
Not applicable
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
HowardTreisman
Level 9
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
Not applicable
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?
pguerett
Level 10
Level 10
There is a server product called Forms in the LiveCycle family that does this for you.