Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Info for PIMain.c:
Source code that must be linked into every plug-in.
Don't change this file and don't change the header files.
Copy link to clipboard
Copied
Pimain.cpp is “stock” code. You do not edit it and don’t need to read it, but it must be part of every plugin project
The other modules are structured how you like and could be one file or more files. I think Adobe like to separate the initialisation code (which defines all the callbacks) and the callbacks themselves.
I think you you have two main areas to focus on that are specific to your plugin.
1. What sort of highlighting? For example, is it saved forever in the document, or only visible if your plugin is active? Describe a similar highlight.
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.
Also do consider very carefully whether your plugin will interfere with the normal use of Acrobat for other tasks.
Copy link to clipboard
Copied
ok so we just need to highlight the words when our plugin is active
Copy link to clipboard
Copied
so you mean, the PIMain.c file's code is fixed for all plugins and that i do not have to change it at all for my plugin??
Copy link to clipboard
Copied
Correct.
It is the main part for all plugins.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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...
Copy link to clipboard
Copied
can you please elaborate on the conditions you have told before(including "at some point what if the user wants to stop")???(i have really not understood what you mean, so please explain using simple technical terms)
Copy link to clipboard
Copied
You have to use callbacks for their intended purpose. MyPluginIsEnabled is called (if you specify it on AVMenuItemNew) to check if your plug-in menu item is enabled. That's all you can do. This may be called zero, one or more times, at unpredictable intervals. If you don't understand event driven programming this is going to be difficult for you.
Copy link to clipboard
Copied
k so i have finally integrated my HighlightWords plugin in AcrobatSDK menu...
The word is highlighted in blue colour.
but that particular word gets de-highlighted if i press anywhere else in the file..this should not happen..
basically, the word has to stay highlighted(in other words,stay annotated) in yellow color at all times till that pdf is loaded there.
how can that be achieved???
Copy link to clipboard
Copied
Look at TSN's remarks five replies back regarding the redraw event.
Copy link to clipboard
Copied
Want you highlight or markup the words?
Copy link to clipboard
Copied
what do you mean by markup??
Copy link to clipboard
Copied
Copy link to clipboard
Copied
basically i want to highlight a word till that pdf is loaded in the acrobat..
possibly with yellow color
while, what is happening right now is...the word is highlighted with a blue color but the highlight goes away once i press somewhere else in the pdf
Copy link to clipboard
Copied
i think markup is also fine as long as it does not go away till the pdf is loaded there
Copy link to clipboard
Copied
What does you mean with "till the pdf is loaded" ?
Copy link to clipboard
Copied
i mean when a pdf is opened in acrobat....and then i select my HighlightWordsPlugin from the menu item under Acrobat SDK...at that time a word gets highlighted....
but the highlight goes away once i press somewhere else in the pdf....this should not happen...
this word should remain highlighted in yellow color as long as that particular pdf is opened in the acrobat
Copy link to clipboard
Copied
This is not plugin code. Googling is not programming.
Copy link to clipboard
Copied
ya..its not working even
Copy link to clipboard
Copied
https://help.syncfusion.com/file-formats/pdf/working-with-annotations
so you mean these are not the codes for plugin generation in Visual Studio?
(because they seem like it)
Copy link to clipboard
Copied
You need to actually program. Not hack pieces of code you find. Read the code and examine each line until you understand it. This is a long process of learning and discovery. Copy and paste is not programming.