Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list
SOLVED

Auto Exit on Print

Avatar

Level 2

I am still a bit new to LiveCycle and very new to scripting. Is there a way were I can set my form to exit automatically when the print button is selected? So the form is filled out, user hits print button, the form print and exits (form closes, doesn't have to save data) Any assistance would be greatly appreciated. Thank you.

1 Accepted Solution

Avatar

Correct answer by
Level 10

There is a command to close the current doc:

event.target.closeDoc(true);

The true indicates that the doc will be closed without forcing a save .....if false then a dialog will pop up asking the user to save if any changes to the doc have been made.

Note that this will only close the current doc. Acrobat/Reader or the browser are still open....and I do not think you can automatically close those as they are running your script.

Paul

0 Replies

Avatar

Correct answer by
Level 10

There is a command to close the current doc:

event.target.closeDoc(true);

The true indicates that the doc will be closed without forcing a save .....if false then a dialog will pop up asking the user to save if any changes to the doc have been made.

Note that this will only close the current doc. Acrobat/Reader or the browser are still open....and I do not think you can automatically close those as they are running your script.

Paul

Avatar

Level 4

If the PDF is opened in browser it won't close by script, it will give an error, also, if your PDF is not interactive or the Reader has Javascript turned off it won't close either.

Avatar

Level 2

Ok after I found where I should put this script and it works, its didn't close Adobe reader as you said but it works. Thanks for your help!

Avatar

Level 2

Ok after I found where I should put this script and it works, its didn't close Adobe reader as you said but it works. Thanks for your help