Based on Adobe Acrobat SDK document "Javascript for Acrobat API Reference": Pg 146 I have been able to get the trusted function to work and save a file to a particular path with a non-dynamic name. However I have yet to figure out why the document will not save the field entry I specify as the file name.
http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/js_api_reference.pdf
Pg 146 Example 1
The Javascript trusted function saved in the Acrobat apps folder:
mySaveAs = app.trustPropagatorFunction(function(doc,path)
{
app.beginPriv();
var myDoc = event.target;
myDoc.saveAs(path);
app.endPriv();
})
myTrustedSpecialTaskFunc = app.trustedFunction(function(doc,path)
{
// Privileged and/or non-privileged code above
app.beginPriv();
mySaveAs(doc,path);
app.endPriv();
// Privileged and/or non-privileged code below
});
Javascript code I have on my button click:
xfa.resolveNode("RA");
myTrustedSpecialTaskFunc(this, "/c/temp/" + RA + ".pdf");
this returns a saved file with the name of: [object XFAObject].pdf in the folder specified above.
The Javascript code in the Adobe example is:
myTrustedSpecialTaskFunc(this, "/c/temp/mySavedDoc.pdf");
this returns a pdf file in the specified folder with a file name of "mySavedDoc.pdf"
I am using MS XP with Adobe LiveCycle Designer ES2 and Adobe Acrobat X Pro