Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
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
Former Community Member

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

View solution in original post

4 Replies

Avatar

Correct answer by
Former Community Member

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

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----