Save FDF as a silently and using name from Acrobat form field.
Dear All;
I would like to save the donation receipt information as a FDF, which is I already created through Acrobat Pro DC version 2019.008.20080 fillable form.
Again, through the code I found on this forum site, I can save the PDF form as a complete. But I want to save as a FDF, how to change the JavaScript code for this purpose?
Thanks in advance for your help
Code:@ !
I used the script below in my Javascript folder:
var mySaveAs = app.trustedFunction(
function(oDoc, cPath, cFlName) {
// Ensure path has trailing "/"
cPath = cPath.replace(/([^/])$/, "$1/");
try {
app.beginPriv();
oDoc.saveAs(cPath + cFlName);
app.endPriv();
} catch (e) {
app.alert("Error During Save - " + e);
}
}
);
This script for the button in Acrobat Form.
var directory = "/Users/hasankoyuncu/Desktop/untitled folder/"
if (typeof(mySaveAs) == "function") {
mySaveAs(this, directory, this.getField("BenefactorName").value + " " + this.getField("NameOfCharity").value + " " + this.getField("DonationDate").value + ".pdf");
} else {
app.alert("Missing Save Function. Please contact forms administrator ");
}
My system is:
MacBook Pro (Retina, 15-inch, Mid 2014)
