Skip to main content
rakeshk21205956
Inspiring
January 12, 2017
Question

Saving PDF Form with Filename picked from the form fields

  • January 12, 2017
  • 1 reply
  • 1462 views

I want to save my PDF form with a filename which will be picked from one of the form fields. I don't want path to be prefixed.. that may choosed by the user in the traditional way.. i only want the filename to be automatically there in the SAVE As dialog box from one of the form fields.

I got some of script from internet but none of them work for me.

// get the value of the form field

var text1Value = this.getField("Text1").value;

// make a file name from the field value

var newFileName = text1Value + ".pdf";

// get the path where the file is currently located

var filePath = this.path.replace(this.documentFileName);

// create the new full path

var newFullFilePath = filePath + newFileName;

try {

this.saveAs(newFullFilePath); // Only this will not work from a button...

} catch (e) {

app.alert("Error! Could not save as: " + newFullFilePath);

}

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
January 12, 2017
rakeshk21205956
Inspiring
January 12, 2017

but i didnot got how ........ plz give me  a javascript

try67
Community Expert
Community Expert
January 12, 2017

For what, exactly? As we told you, your request is not possible without a folder-level script.