Use acrobat standard tool in custom annotation plugin

Ask a Question related to Adobe Acrobat SDK, Design and Development.

  1. #1

    Default Use acrobat standard tool in custom annotation plugin

    Hello,

    want to develop a custom annotation plugin to draw a line or a polyline. Therefore i'd like use the standard tools like Pencil and Polyline, because their behavior is right what i need. I just want to set a different color and a special status.

    So what i want to do is create 3 buttons (not the problem), for example to use the pencil tool, which all have individual color and status preset.

    Is it possible to call those standard tools an set the desired properties up front?

    I use Acrobat 8.1.3.
    Solution could be in C or JavaScript.

    Thanks a lot,
    Alex
    A._Mas@adobeforums.com Guest

  2. Similar Questions and Discussions

    1. anybody interested in maintaining acrobat plugin for use of itextwithin acrobat?
      Hi, Is anybody interested in hosting and maintaining the sourcecode of a acrobat plugin to extend acrobat using itext? A few years ago I wrote a...
    2. Does Acrobat Browser plugin allow full Adobe Acrobat 7.0 functionality
      Hello, currently I’m starting a new project. I have to design and implement a document retrieval system. The document format is PDF. The...
    3. Form Tool in Acrobat Standard -- HELP
      I have Adobe Acrobat 6.0 STANDARD. I have downloaded an electronic fillable document from the IRS website. I am trying to edit one of the pre-defined...
    4. Acrobat 6.0 Standard upgrade from Acrobat 4.0 in Windows 98
      Acrobat 4.0 has always worked just fine on my Toshiba Satellite laptop (Pentium 2/350, 64Mb RAM, 2.3 Gb free diskspace) running Windows 98...
    5. Bookshelf in Acrobat Standard vs. Acrobat Professional
      Are there any significant differences; Right now, I find the Bookshelf somewhat useful, but a bit cumbersome to use. For example, you can't easily...
  3. #2

    Default Re: Use acrobat standard tool in custom annotation plugin

    Yes, it is possible. You will need to write in C/C++, since that is the language of plugins.
    Leonard_Rosenthol@adobeforums.com Guest

  4. #3

    Default Re: Use acrobat standard tool in custom annotation plugin

    Thanks for the reply.

    Probably i need to use the AVAppGetToolByName methode to get the tool, according to the API reference. If you have a short hint how to activate and how to set simple preferences, like color, that would be amazing.

    AVAppGetToolByName returns AVTool, which is a structure called _t_AVTool. I asume, i have to set the preferences in there, before i active it somehow, don't i?

    Thanks,
    Alex
    A._Mas@adobeforums.com Guest

  5. #4

    Default Re: Use acrobat standard tool in custom annotation plugin

    Hi,

    so, it was pretty easy :-) to activate the tool,

    AVTool tool = AVAppGetToolByName(ASAtomFromString("Ink")); AVAppSetActiveTool (tool, true);

    but, i canīt find where to change the settings for e.g. color in the structure _t_AVTool. Any advise?

    Alex
    A._Mas@adobeforums.com Guest

  6. #5

    Default Re: Use acrobat standard tool in custom annotation plugin

    Look for GetPref/SetPref - it's NOT on a tool by tool basis...
    Leonard_Rosenthol@adobeforums.com Guest

  7. #6

    Default Re: Use acrobat standard tool in custom annotation plugin

    Hi Leonard.

    First, thanks for your time! That's really great.

    I already saw those methods like
    AVAppGetPrefence, AVGetPrefText, AVGetPrefAtom, .... and AVAppSetPreference,
    but then iīm stuck at
    AVPrefsType, or parameters like const char* section and const char* key.

    Sure i can image what they are there for, but nowhere in the documentation is written, what values you can fill in. And Google doesn't help (what surprise!). I also saw another thread (keyword: "worst documentation ever" ), where you gave advise with AVAppSetPreference(PDLayoutSinglePage, 0); .
    Is there maybe new information about those parameter? It's just this "small" aspect, which prevent me from the next step to finish the tool. Thatīs kind of ... no that is frustrating.

    Am i right, if the settings arenīt bound to the tool itself, does acrobat set the preferences everytime you selct a different tool? Since you can set different default values for e.g. color for e.g. polyline and pencil, they alter the preferences within the application, whenever you select the next tool? They set the color in the properties bar, too.

    The only thing iīm still arfraid of, is that i maybe will not be able to change the status upfront. I heard some rumors.

    Thanks again..
    Alex
    A._Mas@adobeforums.com Guest

  8. #7

    Default Re: Use acrobat standard tool in custom annotation plugin

    Details of the various settings/prefs are in one of the headers...

    The alternative is to register for notifications that that drawing is complete and THEN change it...
    Leonard_Rosenthol@adobeforums.com Guest

  9. #8

    Default Re: Use acrobat standard tool in custom annotation plugin

    Sorry, i have to admit, i don't know what kind of headers you are refering to. I'm new to the Acrobat development. Do you have some more details on that?

    I thought about a callback, too. So i implemented the
    AVAppRegisterNotification(PDAnnotWasCreatedNSEL,.. ..
    callback. But for a reason it doesn't work. It does not keep the color.
    I first used the AVAppRegisterNotification(PDAnnotDidChangeNSEL,... ...
    callback. There it work good and changed the color. For example i drew a red line (standard color) and when i released the mousebutton, the "DidChange" callback was called a couple of times and the color was set correct. But i has some unwanted side effects.
    The "WasCreate" callback understandably just gets called once. So i asume the color is set to early.
    But what can i do? Any idear?

    This is my code for setting the color:

    PDColorValueRec pdColorValue;
    memset(&pdColorValue, 0x00, sizeof(pdColorValue));
    pdColorValue.space = PDDeviceRGB;
    pdColorValue.value[0] = fixedZero;//R
    pdColorValue.value[1] = fixedZero;//G
    pdColorValue.value[2] = fixedOne;//B
    PDAnnotSetColor(lAnnot, &pdColorValue);

    Is it the wrong layer for this time/stadium? Do i have to go to the COS layer?

    If you could help i would be great...
    Thanks a lot!
    A._Mas@adobeforums.com Guest

  10. #9

    Default Re: Use acrobat standard tool in custom annotation plugin

    What i forgot to say is...
    the methode discribed in the previous comment is not quite the nice one. Drawing a line in red an then it gets changed to blue, for example.

    To set the properties before starting to draw would be much nicer..
    A._Mas@adobeforums.com Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139