• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

plugin creation

Guest
Aug 07, 2017 Aug 07, 2017

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

TOPICS
Acrobat SDK and JavaScript

Views

12.0K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
replies 152 Replies 152
Community Expert ,
Jul 09, 2019 Jul 09, 2019

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 09, 2019 Jul 09, 2019

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 09, 2019 Jul 09, 2019

Copy link to clipboard

Copied

ok so we just need to highlight the words when our plugin is active

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 09, 2019 Jul 09, 2019

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 09, 2019 Jul 09, 2019

Copy link to clipboard

Copied

Correct.

It is the main part for all plugins.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 09, 2019 Jul 09, 2019

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 09, 2019 Jul 09, 2019

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 09, 2019 Jul 09, 2019

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 09, 2019 Jul 09, 2019

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 09, 2019 Jul 09, 2019

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 09, 2019 Jul 09, 2019

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)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 09, 2019 Jul 09, 2019

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 09, 2019 Jul 09, 2019

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 09, 2019 Jul 09, 2019

Copy link to clipboard

Copied

Look at TSN's remarks five replies back regarding the redraw event.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 09, 2019 Jul 09, 2019

Copy link to clipboard

Copied

Want you highlight or markup the words?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 09, 2019 Jul 09, 2019

Copy link to clipboard

Copied

what do you mean by markup??

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 09, 2019 Jul 09, 2019

Copy link to clipboard

Copied

  1. PdfLoadedDocument document = new PdfLoadedDocument("Input.pdf");
  2. //Gets the first page from the document
  3. PdfLoadedPage page = document.Pages[0] as PdfLoadedPage;
  4. //Add a list to maintain extracted text information
  5. List<TextData> extractedText = new List<TextData>();
  6. //Extract text from first page
  7. page.ExtractText(out extractedText);
  8. foreach (TextData textData in extractedText)
  9. {
  10.     if (textData.Text == "Hello World")
  11.     {
  12.         //Add text markup annotation on the bounds of highlighting text
  13.         PdfTextMarkupAnnotation textmarkup = new PdfTextMarkupAnnotation(textData.Bounds);
  14.         //Sets the markup annotation type as HighLight
  15.         textmarkup.TextMarkupAnnotationType = PdfTextMarkupAnnotationType.Highlight;
  16.         //Sets the content of the annotation
  17.         textmarkup.Text = "Highlight Text";
  18.         //Sets the highlighting color
  19.         textmarkup.TextMarkupColor = new PdfColor(Color.LightPink);
  20.         //Add annotation into page
  21.         page.Annotations.Add(textmarkup);
  22.     }
  23. }
  24. ************************
  25. found this snippet... will it achieve what i want??
  26. and if i use this, then the HiliteEntry object snippet will no longer be required???

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 09, 2019 Jul 09, 2019

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 09, 2019 Jul 09, 2019

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 10, 2019 Jul 10, 2019

Copy link to clipboard

Copied

What does you mean with "till the pdf is loaded" ?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 10, 2019 Jul 10, 2019

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 10, 2019 Jul 10, 2019

Copy link to clipboard

Copied

This is not plugin code. Googling is not programming.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 10, 2019 Jul 10, 2019

Copy link to clipboard

Copied

ya..its not working even

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 10, 2019 Jul 10, 2019

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)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 10, 2019 Jul 10, 2019

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines