Expand my Community achievements bar.

SOLVED

Using the print button to print then close a document

Avatar

Level 1

I use Live Cycle Designer to create my Adobe documents.  I am working on a kiosk project and one of the menus navigates to a document page that has PDF documents and forms for users to print out.  The way the kiosk is designed, I would like for my pdf file to close after the print button is selected.  I recieved a solution in the general Adobe forum, but later found out the script does not work if the document was made using Live Cycle.  Any suggestions???  Is it possible??? Thanks.

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

Open your PDF file in adobe livecycle designer, select print button on PDF.

Go to windows(in adobe designer menu bar) and select Script Editor - In Show dropdown list select postPrint event and copy paste the code below-

app.execMenuItem("Close");

Regards-

Chalukya.

View solution in original post

5 Replies

Avatar

Former Community Member

Hi,

what solution did u get from Adobe forum ?

you can write either of the following script on post-print event (print-button) to close the PDF after the print button is clicked -

app.execMenuItem("Close"); (JavaScript)

OR

event.target.closeDoc(true); (FormClac)

Regards -

Chalukya.

Avatar

Level 1

OK thanks for the reply, my next question is how do I go about adding the script to the print button.  I've tried right clicking, I've tried different options on the menus and I don't see an option to add script.

Avatar

Correct answer by
Former Community Member

Open your PDF file in adobe livecycle designer, select print button on PDF.

Go to windows(in adobe designer menu bar) and select Script Editor - In Show dropdown list select postPrint event and copy paste the code below-

app.execMenuItem("Close");

Regards-

Chalukya.

Avatar

Former Community Member

Hi,

You can also search for Scritp Editor in Adobe Designer Help, you will get the info about script editor.

All the best -

Chalukya.

Avatar

Level 1

Thank you so very much, it works like a charm. 

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] ----