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

Force Adobe to close

Shorbie
Registered: Sep 18 2008
Posts: 6

Originally i wanted to force reader to open but teh alternative chosen was to have a message box that informed the user to view this file with Adobe Reader if it were opened with a professional version. it works great but it has to do one more thing.

Once you click the "ok" button in the pop-up message, Adobe Pro stays open and continues to open the form file through Adobe Pro. Is there a way to force Adobe to close and not continue opening the file once the message telling to use Reader has been read? If so what is the Javascript for that? i have been trying to get the this.closeDoc() to work but it just doesnt want to.

Here is the script that I inserted for the message box:

if (xfa.host.appType == "Reader") {
if (xfa.host.version < 7) xfa.host.messageBox("Currently the application version your are using is "+xfa.host.version+".\nAn application version of Adobe Reader 7.0 or higher is required this form to function properly.")

}else {
xfa.host.messageBox("Please open this doc in Reader");
}

So again, is there a way to force Adobe to quit after the "OK" has been clicked? if this script is wrong or messy please advise me on how to correct it. i truly appriciate any and all thoughs/suggestions.

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Adobe is a very large and diverse company. I think the only reasonable strategy would be a hostile takeover. Do you have access to several billion dollars? But you know, none of us here at this forum want Adobe to close. If it did we'd all be out of business. Shame on you for suggesting such a thing;)

"Adobe" is the name of a company, not a product. I think you might mean "Acrobat", which one of many products made at "Adobe".

And No, you cannot force "Acrobat" to close from JavaScript.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/]http://www.adobe.com/devnet/acrobat/[/url]

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

Shorbie
Registered: Sep 18 2008
Posts: 6
i stand corrected...

ok, so in all honesty, it isnt Acrobat that needs to close. just the file. is that a possibility?
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Yes, use the "closeDoc()" function. Since this is for an XFA document use:

event.target.closeDoc(true);

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/]http://www.adobe.com/devnet/acrobat/[/url]

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