Skip to main content
August 8, 2017
Question

plugin creation

  • August 8, 2017
  • 34 replies
  • 15730 views

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 has been closed for replies.

34 replies

Legend
July 9, 2019

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?

Known Participant
July 9, 2019

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...

Legend
July 9, 2019

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.

Known Participant
July 9, 2019

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.

Legend
July 9, 2019

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.

Legend
July 9, 2019

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.

Known Participant
July 9, 2019

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

Known Participant
July 9, 2019

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?

Legend
July 9, 2019

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

Known Participant
July 9, 2019

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

Bernd Alheit
Community Expert
Community Expert
July 9, 2019

It is all available in the Acrobat SDK:

Acrobat DC SDK Documentation

Legend
July 9, 2019

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?

Known Participant
July 9, 2019

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

Legend
July 8, 2019

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.

Known Participant
July 8, 2019

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??

Bernd Alheit
Community Expert
Community Expert
July 8, 2019

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

Legend
July 8, 2019

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.

Known Participant
July 8, 2019

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??

Legend
July 8, 2019

> 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.

Known Participant
July 8, 2019

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

Legend
July 4, 2019

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.