Thread View: adobe.acrobat.sdk
9 messages
9 total messages
Started by A._Mas
Fri, 20 Mar 2009 10:38
Use acrobat standard tool in custom annotation plugin
Author: A._Mas
Date: Fri, 20 Mar 2009 10:38
Date: Fri, 20 Mar 2009 10:38
13 lines
1123 bytes
1123 bytes
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
Re: Use acrobat standard tool in custom annotation plugin
Author: Leonard_Rosenthol
Date: Mon, 23 Mar 2009 10:38
Date: Mon, 23 Mar 2009 10:38
1 lines
696 bytes
696 bytes
Yes, it is possible. You will need to write in C/C++, since that is the language of plugins.
Re: Use acrobat standard tool in custom annotation plugin
Author: A._Mas
Date: Tue, 24 Mar 2009 13:04
Date: Tue, 24 Mar 2009 13:04
8 lines
1012 bytes
1012 bytes
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
Re: Use acrobat standard tool in custom annotation plugin
Author: A._Mas
Date: Tue, 24 Mar 2009 15:15
Date: Tue, 24 Mar 2009 15:15
9 lines
869 bytes
869 bytes
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
Re: Use acrobat standard tool in custom annotation plugin
Author: Leonard_Rosenthol
Date: Tue, 24 Mar 2009 19:05
Date: Tue, 24 Mar 2009 19:05
1 lines
683 bytes
683 bytes
Look for GetPref/SetPref - it's NOT on a tool by tool basis...
Re: Use acrobat standard tool in custom annotation plugin
Author: A._Mas
Date: Wed, 25 Mar 2009 08:53
Date: Wed, 25 Mar 2009 08:53
18 lines
1859 bytes
1859 bytes
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
Re: Use acrobat standard tool in custom annotation plugin
Author: Leonard_Rosenthol
Date: Wed, 25 Mar 2009 12:03
Date: Wed, 25 Mar 2009 12:03
3 lines
774 bytes
774 bytes
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...
Re: Use acrobat standard tool in custom annotation plugin
Author: A._Mas
Date: Wed, 25 Mar 2009 15:43
Date: Wed, 25 Mar 2009 15:43
24 lines
1943 bytes
1943 bytes
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!
Re: Use acrobat standard tool in custom annotation plugin
Author: A._Mas
Date: Thu, 26 Mar 2009 08:08
Date: Thu, 26 Mar 2009 08:08
4 lines
832 bytes
832 bytes
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..
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads