Javascript (Util?) function equivalent to livecycle exportdata function | Community
Skip to main content
New Participant
February 15, 2023
Solved

Javascript (Util?) function equivalent to livecycle exportdata function

  • February 15, 2023
  • 1 reply
  • 1603 views

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);
}

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

Mayank_Gandhi
Employee
February 17, 2023

@grantefuller isnt this working for you?

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

 

New Participant
February 17, 2023

@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)

Mayank_Gandhi
Employee
February 21, 2023

@grantefuller dropped a msg in inbox