Skip to main content
Aug 8, 2017 5:13 AM UTC
Question

plugin creation

Hi!

I am new to acrobat plugins.  I am having set of tools developed in acrobat java script like auto bookmarking.  I wanted to convert this into plugins using c++.  I dont know where to start and how to start.  Can any one help me on this?  How to create?  Which platform is required to create plugin?  How to create .api file?

Ariv

This topic is closed to new replies. Start a new post to keep the conversation going.

152 replies

Legend
Jul 9, 2019 10:28 AM UTC

Plug-ins are an event driven process. The only things that happen in your code are because of events, so you cannot dismiss this for later.

So... when the user selects from the menu the plug-in highlights text.

Typically highlights are drawn on each time the page is redrawn (for example after the user zooms or scrolls). This means you have to respond to page draw events. You also have to NOT respond to redraw events for a different document. Drawing is not a simple task, and best not included in a first project.

At some point the user will want to stop - do you plan a separate menu item for that?

Translate
Known Participant
Jul 9, 2019 11:24 AM UTC

i really dont know...

i have just put the HiliteEntry code in MyPluginIsEnabled() in HighlightWords.cpp class and i am getting a lot of errors...

Translate
Legend
Jul 9, 2019 10:02 AM UTC

2. What events  run your code? For example, will your code run only when someone chooses a menu item? Or at intervals? Many possibilities, but also many limitations.

Translate
Known Participant
Jul 9, 2019 10:14 AM UTC

ok this is all too overwhelming....

for now we are just interested to make  a plugin that highlights certain words of the pdf when it is active(as in when someone selects our HighlightWords plugin from the AcrobatSDK drop down)..

for now we are not taking other possibilities into consideration.

Translate
Legend
Jul 9, 2019 8:48 AM UTC

Also you will need to be a C or C++ programmer. We cannot fill in that gap in your knowledge and will not create sample code for you.

Translate
Legend
Jul 9, 2019 8:42 AM UTC

Why do you want sample code, when you aren't going to run Acrobat??

Have you looked at the SDK documentation? There are thousands of pages of methods, and you won't want to read all that for the first day, but there is a lot of necessary information. You will also need basic knowledge of PDF internals and graphics models - see the PDF Reference.

Translate
Known Participant
Jul 9, 2019 8:58 AM UTC

ofcourse i will be running acrobat. i am running it.

i read the documentation.

it was all really verbose.

the layer architecture and gazillion methods of the APIs.

so, it would be convenient if you could tell me a few particular methods to concentrate on for highlighting text in pdf

Translate
Known Participant
Jul 9, 2019 9:04 AM UTC

also, each plugin in the sample plugin has 3 files...example: basicplugin.cpp, basicpluginInit.cpp and PIMain.c

what is the purpose of three files???

and what to write in all theses 3 files while developing my custom plugin?

Translate
Legend
Jul 9, 2019 7:37 AM UTC

Then you must contact Adobe Customer Services. WE CANNOT DO THIS IN THE FORUM.

Translate
Known Participant
Jul 9, 2019 8:36 AM UTC

the sample plugin is finally integrated with the Acrobat DC.

now, i want to write a plugin that highlights certain text from the pdf opened in adobe.

can you please guide on this??

like which methods and API have to be used because the .cpp file codes of the sample plugins are completely foreign to me

Translate
Bernd Alheit
Community Expert
Community Expert
Jul 9, 2019 8:47 AM UTC

It is all available in the Acrobat SDK:

Acrobat DC SDK Documentation

Translate
Legend
Jul 9, 2019 7:29 AM UTC

Contact Adobe customer service immediately. There is a very limited time for a refund, before you automatically commit to a contract.  But why would you cancel? You cannot do this project if you don't have Acrobat, why would you even start it?

Translate
Known Participant
Jul 9, 2019 7:34 AM UTC

i need to cancel for now because i put my card details and not the company's

Translate
Legend
Jul 8, 2019 11:11 AM UTC

I don't understand your question. "Enabled to Acrobat" is not a familiar term.


The plug-in only runs when it is loaded by Acrobat Pro. Until you run it in Acrobat Pro, nothing will run, nothing exists, there is no output, no breakpoints have any effect, nothing.

Imagine your question as "how can I get results from my EXE file without running it" and you will see that your question is difficult for us to answer.

More details:

1. a plug-in is loaded by Acrobat Pro when you start Acrobat Pro, if it is in the right folder, and built correctly.

2. Acrobat Pro runs the PluginMain routine, which must do certain setup. If the setup is not done correctly, the plug-in is unloaded and forgotten.

3. The setup must define some callbacks. These could include menu items in Acrobat (this is easiest for testing).

4. The plug-in code is not touched until the callbacks are needed. For example, if you added a menu item in Acrobat, then a routine in your code will be executed when the end user selects the menu item.

If you are trying to write a plug-in from scratch, stop and throw this away.

Translate
Known Participant
Jul 8, 2019 11:23 AM UTC

ok last question...

So when i run/build the solution file of  BasicPlugin(i.e BasicPlugin.sln file) in visual studio, even at that time also i cannot know the functionality of that file by putting breakpoints in visual studio before .api file gets created??

Translate
Bernd Alheit
Community Expert
Community Expert
Jul 8, 2019 11:33 AM UTC

You can see the functionality of the plugin in the source code of the plugin.

Translate
Legend
Jul 8, 2019 11:02 AM UTC

You can suppose what you like, but that isn't what will happen, and it isn't what we'd expect to happen. Find an alternative. I explained how you can make output. You can also use breakpoints to discover what your plug-in is doing. This can be awkward, but it is well worth the effort.

Translate
Known Participant
Jul 8, 2019 11:06 AM UTC

so you mean that the actual functionality of the plugin can only be seen once it gets enabled to Acrobat??

and until then, debugging using breakpoints from visual studio might help??

Translate
Legend
Jul 8, 2019 10:30 AM UTC

> once i build a plugin in visual studio, only a couple of libraries and .api file gets generated.

The API is the complete deliverable - what you or others install to Acrobat.

> but the output of the plugin does not appear on the console.

That's correct. Plug-ins are not command line tools to write to the console. GUI apps don't write to the console.

If you want to write information, open a file. If you want to inspect the file while Acrobat is running, use Open (Append), Write, Close for each line.

Translate
Known Participant
Jul 8, 2019 10:35 AM UTC

sorry but i did not understand your answer at all. Please elaborate or send a link for the same

Translate
Legend
Jul 4, 2019 11:57 AM UTC

You need to use the exact version in the documentation for your SDK. Once you are an expert you may be able to convert your project to run in another release.

Translate