Copy link to clipboard
Copied
I do not know javascript, but need to create a button action in a pdf form that will save the document using the "project title" form field data as the file name. Below is what I have pulled together and have no luck. When I hit save, nothing happens. I've read through the posts and see similar questions, but can't figure anything out.
// Get the value of the form field
var fieldValue = this.getField("projecttitle").value;
// Create a file name using the form field value
var fileName = fieldValue + ".pdf";
// Save the PDF with the specified file name
this.saveAs(fileName);
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Thank you; from what I've read, this needs to be a trusted function so I will review these tutorials.
Copy link to clipboard
Copied
Updated articles:
https://www.pdfscripting.com/public/How-to-Save-a-PDF-2.cfm
https://www.pdfscripting.com/public/Trust-and-Privilege-in-Acrobat-Scripts.cfm
https://www.pdfscripting.com/public/Using-Trusted-Functions.cfm