- Mark as New
- Follow
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report
Here is the trusted function file in Acrobat?javascript
var mySaveAs = app.trustedFunction(
function(doc,name){
app.beginPriv();
doc.saveAs(name);
app.endPriv();
})
How can I adapt the code below (which works in Acrobat) for LC?
newDocName = "";
f1 = this.getField("topmostSubform[0].Page1[0].Last_Name[0]").valueAsString;
if (f1!="") newDocName += f1 + " ";
f2 = this.getField("topmostSubform[0].Page1[0].First_Name[0]").valueAsString;
if (f2!="") newDocName += f2 + " ";
f3 = this.getField("topmostSubform[0].Page1[0].Date[0]").valueAsString;
if (f3!="") newDocName += f3 + " ";
f4 = this.getField("topmostSubform[0].Page1[0].Email[0]").valueAsString;
if (f4!="") newDocName += f4;
newDocName = newDocName.replace(/[\\,\/,\:,\*,\?,\",\<,\>,\|,\,,\n,\r]/g,"");
docPath = this.path+"";
docPath = docPath.substring(0, docPath.lastIndexOf("/")+1);
mySaveAs(this,docPath+newDocName+".pdf");
Views
Replies
Total Likes