Skip to main content
arge1234
Known Participant
April 25, 2016
Answered

Adobe Reader plugin commandline variable

  • April 25, 2016
  • 2 replies
  • 1301 views

Hello.

For work I am making an Adobe read pluging.

Is it possible to pass a textstring to the adobe reader executable and search for this text string with my own plugin and highlight these instances on the first pdf document page ?

My plugin requires a text string to highlight.

Can I pass the text string from an external application ?

This topic has been closed for replies.
Correct answer Test Screen Name

The plugin is loaded with Acrobat/Reader.  Plugins are not apps to be invoked, rather they are a collection of callbacks. you have an initialisation callback, which regusters the others. Don't think of Acrobat as being a command line with a file on it. Acrobat starts. At some point file(s) are opened. If you registered for suitable call backs (like PDDocDidOpen) your callbacks will be called. In any order, any number of times. You can register an Idle procedure too, which gets a callback when Acrobat is idle.

2 replies

Test Screen NameCorrect answer
Legend
April 26, 2016

The plugin is loaded with Acrobat/Reader.  Plugins are not apps to be invoked, rather they are a collection of callbacks. you have an initialisation callback, which regusters the others. Don't think of Acrobat as being a command line with a file on it. Acrobat starts. At some point file(s) are opened. If you registered for suitable call backs (like PDDocDidOpen) your callbacks will be called. In any order, any number of times. You can register an Idle procedure too, which gets a callback when Acrobat is idle.

Legend
April 25, 2016

I don't think there is any possibility with the command line. You can invent your own way to communicate with your plug-in if you are careful with these rules.

1. A plug-in cannot stop and wait for events in the main thread without blocking the app.

2. A plug-in can create new threads but must not use any Acrobat API whatsoever in these new threads.

The very simplest approach would be to create a file in a known location which the plug-in looks for. Be sure to identify the target file, as your plug-in may be called for other PDFs, including invisible PDFs used internally, and PDFs shown in external windows. Subject to the above restrictions you can create COM servers or other kinds of IAC.

arge1234
arge1234Author
Known Participant
April 26, 2016

Thank you,

Is there also a way, that my plug-in starts automatically when Reader starts ?

Bernd Alheit
Community Expert
Community Expert
April 26, 2016

The plug-in will loaded with the start of Reader.