Skip to main content
Participant
January 4, 2021
Question

How to listen for document open in acrobat

  • January 4, 2021
  • 3 replies
  • 848 views

Hi All,
I am trying to register document open event handler via javascript but I am unable to listen the event.
I am registering it by using SetAction method.

this.setAction("Open", docOpen);

 

But when I am opening the document, I am getting error message TypeError: this.setAction is not a function
I am trying this on Adobe Acrobat Reader DC. Please note that I am new to this. 

 

I found this https://community.adobe.com/t5/acrobat-sdk/listen-for-doc-open-event-from-folder-level-script/m-p/9418297?page=1#M28501  but the link given in there is not working. 

Any help will be appreciated.

Regards!

This topic has been closed for replies.

3 replies

Bernd Alheit
Community Expert
Community Expert
January 5, 2021

Where does you this script?

Legend
January 5, 2021

To develop plug-ins you would need the paid-for Acrobat. Once you have developed and debugged them you can apply for a Reader plug-in license, fees are variable. If you get as far as building a plug-in, debug them by setting Acrobat as the executable, or connect to the Acrobat executable.

 

If you'd like to note what you are trying to achieve (why you want to know that documents are opened) we may be able to give more focussed advice, or dire warnings about traps...

leonaidasAuthor
Participant
January 7, 2021

Thanks for pointing me in right direction. Sorry I am bit late in reply. 

I am using Acrobat now and able to load my plugin there. I've successfully registered the open document event handler. 
I found this helpful link.

 

 

 

 

try67
Community Expert
Community Expert
January 4, 2021

That won't work because "this" refers to a specific document. Such an "event listener" has to work at the app-level, and has to exist in a folder-level script, monitoring the activeDocs array for new items. It's not a simple coding task at all.

leonaidasAuthor
Participant
January 5, 2021

Ok, so seems like scripting is not a good option for registering the events. Should I explore C/C++ plugins for registering event listener?

 

Can you please direct me to the instructions how to directly launch the Acrobat Reader DC from VS for debugging?

 

Thanks for your time and help.