- Mark as New
- Follow
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report
Hi,
You could create a save button with the following in the click event:
event.target.myTrustFunct(event.target);
Then in the .js file you will have similar javascript (based on Acrobat User Group thread):
// place this .js file in C:\Program Files\Adobe\Acrobat 9.0\Acrobat\Javascripts
//
// folder level JavaScript to allow access to the identity object properties
trustedIdentity = app.trustedFunction(function (sProperty)
{
var iProperty = "";
app.beginPriv(); // explicitly raise privilege
iProperty = identity[sProperty];
app.endPriv();
return iProperty;
})
// folder level JavaScript to allow Save As population of file name
mySaveAs = app.trustPropagatorFunction(function(myForm, path)
{
app.beginPriv();
var myForm = event.target;
return rtn = dmaicForm.saveAs(path);
app.endPriv();
});
myTrustFunct = app.trustedFunction(function(myForm, path)
{
app.beginPriv();
var proNr = event.target.xfa.resolveNode("#pageSet.Page1.patientName").rawValue;
//console.println("proNr: " + proNr);
var vProNr = proNr.toString();
var vPath = "/c/Folder/HSS Foot & Ankle for Patient " + vProNr + ".pdf";
//console.println("vPath: " + vPath);
var retn = mySaveAs(myForm, vPath);
app.endPriv();
return retn;
});
Then place the .js file in the following application folder (or similar):
“C:\Program Files\Adobe\Acrobat 9.0\Acrobat\Javascripts”
I was putting the above together when you posted, so I am hoping this will get you out of the blocks!!
Hope that helps.
Niall
ps Don't worry about the trustedIdenity javascript at the top; that is for a different purpose, but I have it in the same .js for convenience. Also the above works for us, so I am hoping it will work for you as well.
Views
Replies
Total Likes