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

Capture Document close event- from outside the PDF file

s.arunswami
Registered: Aug 20 2008
Posts: 8

I use Adobe Acrobat Reader 9.0, I have a scenario where I have to intercept a Document close event , each time a document is closed and then call an external executable, Please can you advise if there is any method to accomplish this.

is there any way this event can be trapped outside the PDF file , such as writing Javascript and placing them in folder in C:\Program Files\Adobe\Reader 9.0\Reader\Javascripts.

If yes, Please can you advise and provide me with a sample.

Thanks in anticipation!
Regards,
Arun

My Product Information:
Reader 9.0, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
You cannot directly dectect when a document is closed from some external process. But there are a couple of strategies you could try.

1. Polling: Acrobat has an InterApplication Communication Interface (IAC) that other applications can use to talk to it. You can use this to find out which documents are open, keeping a list, and then checking on it at intervals. You can find the IAC docs here.
[url=http://www.adobe.com/devnet/acrobat/]http://www.adobe.com/devnet/acrobat/[/url]2. Write an Acrobat Plug-in. A plug-in can recieve Doc Close events directly, and it can call an external process.

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