These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Save As Command with File Name coming from two text fields

tully
Registered: Sep 25 2009
Posts: 2

Hi,
I am attempting to use a button that pulls the values from two separate text fields as the file name with the Save as command. Very new using javascript in a pdf document.

My two text fields are:
name
med

I need to know how to create the value string for the file name and the proper Save as command.

Thank in advance for any help.

S.

My Product Information:
Acrobat Pro 8.0, Windows
vomit
Registered: Feb 11 2009
Posts: 8
The developer guide and api reference were extremely helpful for me. Check them out.

[b]To get values:[/b]

name = this.getField("name").value;
med = this.getField("med").value;

[b]To Save:[/b]

filename = name + med + ".pdf"
this.saveAs( filename );
vomit
Registered: Feb 11 2009
Posts: 8
By the way, the saveAs function is a privileged function. This means you won't be able to use it as a javascript action on a button. There should be explanations of this on the forums.

But you can create a trusted function in a .js file placed in the Acrobat javascripts folder.