Auto Rename PDF Form Based on text field data via Button | JavaScript | Adobe Acrobat pro dc 2022

Pubblicato il: 18 agosto 2022
sul canale di: SAR Solutions
5,816
44

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 +


In questa pagina del sito puoi guardare il video online Auto Rename PDF Form Based on text field data via Button | JavaScript | Adobe Acrobat pro dc 2022 della durata di ore minuti seconda in buona qualità , che l'utente ha caricato SAR Solutions 18 agosto 2022, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 5,816 volte e gli è piaciuto 44 spettatori. Buona visione!