We created an inventory sheet using Acrobat Pro X that does some calculations. Once we fill it out we save it to capture the data and then create a flatten version to send to customers to avoid issues with some mobile customers not being able to read the pdf. We save a flatten version with a slightly different name to tell then apart. The original code worked when using a shared network drive. When we try to run the form on the physical drive and same directory Acrobat throws an error "Missing Save Function Please check for blank Shippers Name field". Is there is there a simple fix?
Simple Save
var text1Value = this.getField("Customer").value;
var newFileName = "1 " + text1Value + " Inventory.pdf";
if(typeof(mySaveAs) == "function") {
var nLast = this.path.lastIndexOf("/");
var cPath = this.path.slice(0,nLast);
mySaveAs(this,cPath, this.newFileName);
}
else {
app.alert("Missing Save Function\n" + "Please check for blank Customers Name field");
}
Save and Flatten
var text1Value = this.getField("Customer").value;
var newFileName = "1 " + text1Value + " InventoryF.pdf";
this.flattenPages({nStart: 0, nEnd: (this.numPages - 1), nNonPrint: 0});
if(typeof(mySaveAs) == "function") {
var nLast = this.path.lastIndexOf("/");
var cPath = this.path.slice(0,nLast);
mySaveAs(this,cPath, this.newFileName);
}
else {
app.alert("Missing Save Function\n" + "Please check for blank Customers Name field");
}