In this video, I'm going to show how you can save your PDF form with the new filename of the PDF based on the text field data via Action button javascript.
PDF form, when a user saves the document can anybody share a javascript that would generate the filename of the document based on the data in a form field within the form and for this document to be saved in a separate directory from the original PDF.
Just paste and change text field name.
Button JavaScript:
var myFileName = this.getField("Name").value + this.getField("Text1").value + this.getField("Text2").value + ".pdf";
Folder Level Script:
mySaveAs = app.trustPropagatorFunction(function(doc,path) {app.beginPriv(); doc.saveAs(path); app.endPriv(); })
myTrustedSpecialTaskFunc = app.trustedFunction(function(doc,path) {app.beginPriv(); mySaveAs(doc,path); app.endPriv(); });
myFileName = "/c/temp/" + myFileName
myTrustedSpecialTaskFunc(this, myFileName);
NOTE:
After putting the javascript in SAVE button, restart your adobe acrobat.
Make sure you have created a new folder in drive C and name it "temp".
You can add multiple fields by adding this string in button javascript
this.getField("Nameyourfieldhere").value +
Sur cette page du site, vous pouvez voir la vidéo en ligne Auto Rename PDF Form Based on text field data via Button | JavaScript | Adobe Acrobat pro dc 2022 durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur SAR Solutions 18 août 2022, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 5,816 fois et il a aimé 44 téléspectateurs. Bon visionnage!