Copy link to clipboard
Copied
Hi Everyone. I am making a simple fillable form PDF and I want to put a save button that when pressed it will automatically set the name of the file to what is in the text field "Ebox Work Order Number" and save it to a folder on my network. Is that possible to do at all?
Copy link to clipboard
Copied
Hi,
It's only possible if you write an application script, that means you will have to place a .js file in local on the computer of each user.
@+
Copy link to clipboard
Copied
even if the PDF form is stored on the network as well?? what would the application script look like? Because right now only 4 people would be filling out the form so I would be able to put that script on each computer.
Copy link to clipboard
Copied
Hi,
Sorry, I didn't notice your request!
Attached is an example with this script for the "SAVE AS" button:
if (/^[a-zA-Z0-9]+$/.test(this.getField("orderNumber").value)) {
try {
Save_orderNumber(this.path.substr(0,this.path.lastIndexOf("/")+1)+this.getField("orderNumber").value+".pdf");
this.resetForm();
} catch(e) {
this.getField("theScript").display=display.visible;
app.alert("The \"austin36331818118t.js\" file is not installed on this computer.");
}
} else app.alert("Please enter a correct Order Number");
this.dirty=false;
For working, you must place a .js file in the JavaScript Acrobat folder of each computer. You can name it as you want but it must contain this script:
Save_orderNumber=app.trustedFunction(function(newFilePath) {
app.beginPriv();
this.saveAs({
cPath: newFilePath,
bCopy: true,
bPromptToOverwrite: true
});
app.endPriv();
})
Here, the new file will be saved in the same folder as the original file.
You can modify the condition of your order number or the parameters method.
@+
Copy link to clipboard
Copied
If the form is for you, or for use on a computer you control, then yes you can.
Read this article:
https://www.pdfscripting.com/public/How-to-Save-a-PDF-2.cfm
Saving is a restricted action in Acrobat. To save to a specific file name requires a script, which can only be reliably run in Acrobat. So this feature can only be accomplished in Acrobat Pro/Reader on the desktop app, from a privileged script.