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

"Save" Button that saves file as value inside # Field

vargs
Registered: Jul 2 2010
Posts: 26

Hello,

I have had some trouble creating this button and I was wondering if I could get some help solving it.

I currently have a form that when opened has an 8 digit number automatically assigned to a fixed number field. This number is a way to help identify the form.

What I wanted to find out is if there was a way to implement a "save" button that when pressed, would save the file the same name as this 8 digit id number.

And if there was any way to attatch the phrase "Form No." before the 8 digit id #

To conclude, the file has a number 12345678 generated when the form is opened

when the user clicks save

it will save the form as "Form No. 12345678.pdf"

thanks

-vargs

My Product Information:
LiveCycle Designer, Windows
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Hi,

please check out the forums search.
There are already several threads for this purpose such as
[url]http://www.acrobatusers.com/forums/aucbb/viewtopic.php?id=26920[/url]

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

vargs
Registered: Jul 2 2010
Posts: 26
Hi,
Thanks for the links, it is starting to make a little more sense.
I had a question about the following post.

The only way this save feature will work is if the directory is hard coded in the process or can it be if they have a folder named this that it will work.

If there is no way to avoid hard coding the directory, is there a way to have prompt a pop up that says "would you like to save the file" "yes or no. When they select yes, then the save as box pops up to allow them to map where they would like to save the file.


thanks,

-vargs



Quote:
**************************
Hi George,

You are great. After I enabled Adobe Reader Usage rights in Acrobat Pro, this worked. So to summarize all of this back and forth:

Folder level Config.js file: Applied at location - C:\Program Files\adobe\Reader 9.0\Reader\Javascripts

Code:
//DateTime function
function myDateString() {

return util.printd("yyyymmdd_HHMMss", new Date());

}

// SaveAs Function
var mySaveDoc = app.trustedFunction(function(doc) {

app.beginPriv();
var myPath = app.getPath("user", "documents") + "/WebRequestFiles/" + myDateString() + ".pdf";

// saveAs is the only privileged code that needs to be enclosed
// with beginPriv/endPriv
doc.saveAs(myPath);
app.endPriv();

});

Inline JavaScript: Applied to "regular" button click event

Code:
// SaveAs and close this document
mySaveDoc(event.target);

I have one more question :)
Is there any way possible to change the save to directory to a shared network drive? Or is it only possible to target the user's document directory.

Thank you so much. You saved my life on this one.

Jessica


*************************************
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Hi,

you can also can use scripting to build the save paths dynamically.
Check this sample in my blog.
It has a subform "FileParameters" on the master page that sourrounds several fields I used to build save paths for the current directory of the file and for the "my documents" directory.

[url]http://thelivecycle.blogspot.com/2009/11/save-form-to-specific-directories-and.php[/url]

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs