Expand my Community achievements bar.

SOLVED

XDP Form - button to update drop down list from external file

Avatar

Level 4

Looking to implement a button which will import updated drop down list items on an XDP form.

I have considered a data source, however, the form will be distributed and not have connection to an Access database source.

While the current drop down items are in the form, I need a way for the items to be modified by the admin in the future.

I have seen some examples of using Acrobat to import data which allows for an external XML file to be imported.

The sample I have is a movie database which I downloaded years ago, however, it no longer works in Designer 6.5 and Acrobat Pro.

The file from years ago was DynamicProperties.pdf which I would think some of you have seen in the past.

This may be just what I need, however, it does not work.

Does anyone here have an updated version or a similar example of a similar approach?

Thank you for your time.

1 Accepted Solution

Avatar

Correct answer by
Level 10

Here's a sample to import XML via JavaScript. This method works in Acrobat and Reader as well.

https://thelivecycle.blogspot.com/2014/07/import-xml-via-script-into-adobe-reader.html

 

You can also use the Acrobats readFileIntoStream() method to import data from a simple TXT file. You can write its data into a field or split it into an array of value you the populate your dropdown list with.

var rStream = util.readFileIntoStream("/c/data/myData.txt");
var cFile = util.stringFromStream(rStream);
xfa.resolveNode("myTextField").rawValue = cFile;

 

View solution in original post

1 Reply

Avatar

Correct answer by
Level 10

Here's a sample to import XML via JavaScript. This method works in Acrobat and Reader as well.

https://thelivecycle.blogspot.com/2014/07/import-xml-via-script-into-adobe-reader.html

 

You can also use the Acrobats readFileIntoStream() method to import data from a simple TXT file. You can write its data into a field or split it into an array of value you the populate your dropdown list with.

var rStream = util.readFileIntoStream("/c/data/myData.txt");
var cFile = util.stringFromStream(rStream);
xfa.resolveNode("myTextField").rawValue = cFile;