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

Veröffentlicht am: 18 August 2022
auf dem Kanal: 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 +


Auf dieser Seite können Sie das Online-Video Auto Rename PDF Form Based on text field data via Button | JavaScript | Adobe Acrobat pro dc 2022 mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer SAR Solutions 18 August 2022 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 5,816 Mal angesehen und es wurde von 44 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!