Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Default Save As for PDF

Avatar

Former Community Member

What I would like to do is create a button which would prompt the user to save the file to a defined  network drive\folder

and automatically put the yyyy/mm/dd prefix as the first part of the file name, the users can then add additional data to the the file name.

Is there anyway when you open a form to disable the menu options in Adobe to stop users using those when the form is open.

Thanks

1 Accepted Solution

Avatar

Correct answer by
Level 10

To do this, you need a folder level script with a trusted function.

I have a sample form and script for this.

http://thelivecycle.blogspot.com/2009/11/save-form-to-specific-directories-and.html

View solution in original post

9 Replies

Avatar

Correct answer by
Level 10

To do this, you need a folder level script with a trusted function.

I have a sample form and script for this.

http://thelivecycle.blogspot.com/2009/11/save-form-to-specific-directories-and.html

Avatar

Level 10

Hi,

There is a long thread here on this topic: XFA form with button to save file with unique filename

It is not straight forward and requires a bit of scripting. Also this type of functionality is considered a security risk (hidden activity that may affect the user without the user's knowledge). So in order for this to work, you need a trusted function, which resides in a javascript file, that has to be placed in a specific folder on EVERY computer that is going to use the form. Because of this it is difficult to deploy and maintain.

You cannot disable the menus, however you can open the form to full screen, which 'hides' the menu. You would do this in the docReady event. There are some additional scripts that are also useful if using full screen. Note that it does not prevent the user from using keyboard shortcuts, like Control+S.

Hope that helps,

Niall

Avatar

Level 1

it does not work with what you advised

Avatar

Level 1

Dear Mr. radzmar,

I am so much glad to hear from you,

Adobe livecycle is very nice software, I am learning to make some pdf forms by using this good software, and I still have some difficulties to use the functions, so I am looking through the forums, and try to follow your advise, but still not clear about which folder shall the said JS file be inserted to, so I still failed to make the “save” button working, would you be so kind to help me to solve the problem.

I want to make a pdf document, with a “save” button, which shall have the function of saving the whole pdf document named “test.pdf” in “e” drive, full name with path shall be “e:/test.pdf” automatically,  without popup window.

Or if possible, by the clicking the “save” button in the document,  I’d like it be saved as “e:/test.pdf” plus the date 2 day after today, for example, today is 05/09/19, so the file name will be “e:/test070919.pdf”

Thank you very much

Best Regards

BE ADO

Avatar

Level 10

So first of all you'll have to download the LCB_SaveAs_3_0.js from my sample files and install it on your PC.

LiveCycle Blog: Formulare mit neuem Namen in bestimmtes Verzeichnis speichern//Save forms with new n...

Then you'll have to add a button in your form with this script:

var oDoc = event.target;

    cPath = "/e/";

// Build save path

cPath += "test";

cPath += util.printd("ddmmyyyy", new Date());

cPath += ".pdf";

// Call function in folder level script to save the form.

event.target.lcbSaveAs(oDoc, cPath);

Avatar

Level 1

Thank you for your swift reply, however I am not able to download LCB_SaveAs_3_0.js file, when I click the hyperlink, the website can not be opened,

Avatar

Level 1

HI,radzmar,

Through the link, I have downloaded the LCB_SaveAs_3_0.js file and sample, It is really nice sample file, but when I clicked LCB_SaveAs_3_0.js file to install, it showed a popup warning window, with a window script host message showing the error, row number 22, ‘app’ undefined, code 800A1391.

So the sample did not work due to the LCB_SaveAs_3_0.js file not installed. And showed the error “LCB_SaveAs_3_0.js file is not a function”