Expand my Community achievements bar.

SOLVED

Javascript (Util?) function equivalent to livecycle exportdata function

Avatar

Level 2

I'm looking for a function that would do the same thing as the livecycle xfa.host.exportData function. I no longer have access to Reader Extensions, so I purchased Acrobat Pro to extend to Reader. Upgrading to AEM was just too cost prohibitive for us.  ExportData and importData do not get extended to Reader with Acrobat. I found a function that takes the place of importData using the util.readFileIntoStream shown below (Compliments @radzmar  https://thelivecycle.blogspot.com/2014/07/import-xml-via-script-into-adobe-reader.html) and the import button works fine in Reader. I need to do the same thing to Export XML data from the form. Can anyone point me in the right direction? Maybe there is a util function for it? I've looked exhaustively for a solution.

 

var vStream = util.readFileIntoStream();
if (vStream) {
var vImport, vImportData, vImportXML;
vImport = util.stringFromStream(vStream)
.replace(/(\<\?.*\?\>\s*)|(\<!-{2}(.|\n|\r)*-{2}\>)|(\r\n|\r|\n)/g, "");
vImportData = eval(vImport);
vImportXML = vImportData.toXMLString();
xfa.datasets.data.loadXML(vImportXML, false, true);
}

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor
5 Replies

Avatar

Employee Advisor

@grantefuller isnt this working for you?

xfa.host.exportData("",0);

 

Avatar

Level 2

@Mayank_Gandhi Unfortunately, no. That's the whole problem. You need Reader Extensions or AEM to extend that functionality to Reader. My Reader Extensions in LiveCycle designer has expired and I only have Acrobat Pro. I need a javascript function that will do the same thing. I found one that replaces xfa.host.importData which also won't work in Reader when extended with Acrobat Pro, but need help with a replacement for xfa.host.exportData("",0)

Avatar

Correct answer by
Employee Advisor

Avatar

Level 2

@workflowuser Sorry, but that doesn't apply to my problem and doesn't resolve it. The user needs to be able to export XMLs to different locations. Having it write to the C: Drive and adding all the users that need the form to a trusted identity list isn't feasible. It's used by hundreds of people.