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

Saving a PDF to a specific network folder.

Profy
Registered: Jul 15 2010
Posts: 19
Answered

I have about 6 months of training using LiveCycle, I have gotten pretty good at using it. But this one has got me stumped.

I was reading through the blogs and I tried what was being done on each blog, but I get no results.

I am trying to save to a network folder via VPN. I have it figured out that I can get to the folder just have no luck to make it so I can save specifically to that folder. Currently I use the "Submit" feature under the "Object" library and type in the file name there example: /fapusfl100.companyname.local/common/PDF Transfer/. It works great to get to the folder.

I also have used this script under "Click" feature:

var oMyDoc = Button11.execEvent("click")
app.execMenuItem("saveAs", MyDoc);

It only brings me to the folder not to actually save on that folder.
I tried it this way to see if having a hidden button would help to make the save option appear.

This is probably out there and I just can not figure it. Please help.

LiveCycle Designer ES 8.2, Win, saved as a Dynamic Form

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

try if my example can help you.
I didn't test this with VPN but with shared folders and had no problems.

[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

Profy
Registered: Jul 15 2010
Posts: 19
Thank you for the quick response

I read through what you wrote and I still am a little confused. To make sure i am doing this right,
I copied and pasted the script below to a notepad and saved as LCB_SaveAs.Js in the Javascript folder, which for me is as follows, C:\Program Files\Adobe\Acrobat 9.0\Acrobat\Javascripts

var LCB_SaveAs = app.trustedFunction(function(doc)
{
app.beginPriv();
var LCB_SaveAsTarget = SaveAsTarget;
doc.saveAs(LCB_SaveAsTarget);
app.endPriv();
});

Once that is done I go back to LiveCycle and under JavaScript language, Click, for a new button I add the following to the script editor:

SaveAsTarget = xfa.resolveNode("form1.#pageSet.Page1.FieldWithNewPath").rawValue;
event.target.LCB_SaveAs(event.target);

But for me I would would change my SavAsTarget = line to work with what I am doing.

In your example "FieldWithNewPath" would that be the name of the form you have or is that just to save a specific part of the form to a folder?

Thank You for your help
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
The folder level script goes to the JavaScripts folder of you Acrobat/Reader.
It will be initialized when Acrobat/Reader is started.

Read this tutorials to know what folder level scripts are and do.

[url]http://www.acrobatusers.com/tutorials/2006/folder_level_scripts[/url]
[url]http://www.acrobatusers.com/tutorials/how-save-pdf-acrobat-javascript[/url]
[url]http://www.acrobatusers.com/tutorials/2008/10/using_trusted_functions[/url]

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

Profy
Registered: Jul 15 2010
Posts: 19
I edited my second post, can you please read that post to see if I am doing this correctly.

Thank You
Profy
Registered: Jul 15 2010
Posts: 19
I read through what you wrote and I still am a little confused. To make sure i am doing this right,
I copied and pasted the script below to a notepad and saved as LCB_SaveAs.Js in the Javascript folder, which for me is as follows, C:\Program Files\Adobe\Acrobat 9.0\Acrobat\Javascripts

var LCB_SaveAs = app.trustedFunction(function(doc)
{
app.beginPriv();
var LCB_SaveAsTarget = SaveAsTarget;
doc.saveAs(LCB_SaveAsTarget);
app.endPriv();
});

Once that is done I go back to LiveCycle and under JavaScript language, Click, for a new button I add the following to the script editor:

SaveAsTarget = xfa.resolveNode("form1.#pageSet.Page1.FieldWithNewPath").rawValue;
event.target.LCB_SaveAs(event.target);

But for me I would would change my SavAsTarget = line to work with what I am doing.

In your example "FieldWithNewPath" would that be the name of the form you have or is that just to save a specific part of the form to a folder?

Thank You for your help
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
No,

the name "FieldWithNewPath" in my blog is only a placeholder.
I used it because I have two fields in my sample that shows different save paths.
As the rest of the script is the same I did not post the scripts for both fields separately.
You have to replace it with the field name of that field, that shows the desired save path ;-)

Attention, there is a subform "FileParameters" on the master page, that contains several fields.
Those fields are used to get the current file name and path, to generate new save path strings and also for controlling.
You have to copy the whole subform to your master page to get it work.
If it works you then can set its visiblity to hidden.

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

Profy
Registered: Jul 15 2010
Posts: 19
After looking at your example in LiveCycle and what you have stated in the last post I have a better understanding of what needs to be done.

Thank you for all your help.
Mega
Registered: Dec 14 2009
Posts: 8
Hi

I am also trying to get this done.
I done same as above. As I couldn't see your sample program, I am not clear in which field(button or textfield and in which event) I should put the code for "JavaScript to create save path"(fileparameters.subdirectory - mentioned in your code in save button) in Master page.

Thanks for your help
Mega
Registered: Dec 14 2009
Posts: 8
Hi Profy

Did you get this sorted? And do you have the example form to view in livecycle designer because I couldn't get the form from Radzmar blog.
Thanks for your help
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Read this:
http://acrobatusers.com/tutorials/how-save-pdf-acrobat-javascript

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

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

the download in my blog works ... didn't have any problems with that.

Try this url https://acrobat.com/app.php#d=yciWYLCj4TtvGB10hkFd1w.
You can download a zip file which contains all files you need.

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Wow Radzmar, your blog rocks!!

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Thanks Thom,

I'm glad you like it. ;-)

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

Mega
Registered: Dec 14 2009
Posts: 8
Hi Radzmar

Thanks for the zip file, it works really great. But this is not working in the Adobe reader 9 as I send this form to many of our users to fill who have only adobe reader. I no need to save in specific folder but i need them to save as different name in the same folder or in their mydocuments without prompting for any message and close the file. Is this possible?

Thanks in Advance
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
As Reader executes save scripts with a specified path only from a trusted source (folder level script), your users will have to install the folder level script too.


radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs