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

File Name for Safe File button

PhilHocker
Registered: Nov 28 2006
Posts: 4

Dear AUC,
Like several other postings, I want to put a "Save As" button in forms. Users should be able to hit the button and have their completed form saved as a file, with the file name calculated with js using entries in the form.
 
Can you help? Many thanks.
 
Phil

My Product Information:
Acrobat Pro 8.0999999999999996447286321199499070644378662109375, Windows
pddesigner
Registered: Jul 9 2006
Posts: 858
Add this JS to the mouse up event and name your file as mentioned.

app.execMenuItem("SaveAs");

Make sure you enable Reader extensions before saving the pdf.

My favorite quote - "Success is the ability to go from one failure to another with no loss of enthusiasm.

PhilHocker
Registered: Nov 28 2006
Posts: 4
Eugene, thanks for your answer.

Could you help me a bit further?
In your example, is
MenuItem("SaveAs") a command
that saves the file?

Where does the pre-computed
file name get used as an argument?

Could you give a more
extensive example?

Many thanks. Happy New Year!

Phil.
AlScott
Registered: Nov 2 2007
Posts: 123
Yup- this 'saveas' works well - but I too am trying to figure out how you can get the file name to be one of the field values. For example - you have a field whose contents you've input as "PENGUIN1", then with the 'SaveAs' the file is now called: "PENGUIN1.PDF"??
Yours confused,
A
webpointz
Registered: May 21 2009
Posts: 36
You could try:

var filename = this.myDoc.getField('fieldname').value + '.pdf'