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

Change filename based on field input

prespares
Registered: Nov 6 2008
Posts: 47
Answered

Hello,

I am trying to find the script that will allow me to take the input from a text field and use it as the filename upon clicking a submit button. My button currently performs the saveAs function, and then submits the pdf via email.

Also, can javascript execute a command in Outlook to automatically send the email like you can do in VB?

Thanks!
Joe

My Product Information:
LiveCycle Designer, Windows
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
The element "documentFileName" can't be changed through a script becuase of security reasons.
You can use a script to save the file with a new name to your hard drive (SaveAs), but you can't change the filename of the currently opened file.

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
This is not that easy. Adobe has a number of restrictions on this method in JavaScript. You will need to create an application folder level script that use the trusted function and privileged method. And then this application level folder will need to be installed on every client system.

The reason for the above restriction is to prevent a PDF form being silently being saved without the form user being aware of the action. Some PDF forms have very sensitive personal data like very detailed personal tax information.

See the Acrobat JS API Reference for more information.

George Kaiser