How can I detect which Tooltype is seleted?
Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange
-
- User
- Posts: 275
- Joined: Mon Aug 04, 2008 5:04 pm
How can I detect which Tooltype is seleted?
Hi,
please how can I detect which Tooltype (like rectangle, box, Line, Handtool) is actually seleted?
please how can I detect which Tooltype (like rectangle, box, Line, Handtool) is actually seleted?
-
- Site Admin
- Posts: 7372
- Joined: Wed Mar 25, 2009 10:37 pm
Re: How can I detect which Tooltype is seleted?
HI Dorwol,
whan you select a tool the icon will show up slightly differently to when it is not. You can hit the "Keep tool Selected" button to make sure it stays selected but selected tools should look like a pushed button compared to those not selected.
see attached screenshot. In this example the 'Rectangle Tool' is selected.
whan you select a tool the icon will show up slightly differently to when it is not. You can hit the "Keep tool Selected" button to make sure it stays selected but selected tools should look like a pushed button compared to those not selected.
see attached screenshot. In this example the 'Rectangle Tool' is selected.
You do not have the required permissions to view the files attached to this post.
Best regards
Paul O'Rorke
PDF-XChange Support
http://www.pdf-xchange.com
Paul O'Rorke
PDF-XChange Support
http://www.pdf-xchange.com
-
- User
- Posts: 275
- Joined: Mon Aug 04, 2008 5:04 pm
Re: How can I detect which Tooltype is seleted?
THX, but you dont understand me.
I mean "BY CODE"!
So how can I identify which tool is activated - by Code?
I mean "BY CODE"!
So how can I identify which tool is activated - by Code?
-
- User
- Posts: 223
- Joined: Wed Aug 22, 2007 4:40 pm
Re: How can I detect which Tooltype is seleted?
You need to get the value of "Tools.Active". See sections 2.2.2.13 and 2.2.3.38 in the documentation of the latest build.
-
- Site Admin
- Posts: 798
- Joined: Tue Apr 14, 2009 11:33 pm
Re: How can I detect which Tooltype is seleted?
Thx ugradedeveloper 

If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.
Chris Attrell
Tracker Sales & Support North America
http://www.tracker-software.com
Chris Attrell
Tracker Sales & Support North America
http://www.tracker-software.com
-
- User
- Posts: 275
- Joined: Mon Aug 04, 2008 5:04 pm
-
- User
- Posts: 275
- Joined: Mon Aug 04, 2008 5:04 pm
Re: How can I detect which Tooltype is seleted?
Sorry for one question more, but I want to change some properties of a selected object in my PDF. But I don't know how...
For example, if I want to change the "FColor" of a seleted "Line" object. If "LineTool" is my active Tool, this is no problem (SetProperty "...Styles..."].FColor ...). But how can I change a the properties of a selected object, if the HandTool is still my active Tool?
So how can I detect, which object-Type (not ActiveTool !!!) is selected in my PDF? I need the information, if the selected object is a Line, Rectangle, Oval and so on...

For example, if I want to change the "FColor" of a seleted "Line" object. If "LineTool" is my active Tool, this is no problem (SetProperty "...Styles..."].FColor ...). But how can I change a the properties of a selected object, if the HandTool is still my active Tool?
So how can I detect, which object-Type (not ActiveTool !!!) is selected in my PDF? I need the information, if the selected object is a Line, Rectangle, Oval and so on...

-
- User
- Posts: 664
- Joined: Tue Nov 14, 2006 12:23 pm
Re: How can I detect which Tooltype is seleted?
For now there is no way to detect which object is selected in PDF document.
-
- User
- Posts: 275
- Joined: Mon Aug 04, 2008 5:04 pm
Re: How can I detect which Tooltype is seleted?

OK, that's sad. But how can I change a property of a seleted (unknown) object by code?
For example I want to change the "SColor" of a selected object.
This will not work, because it chages only the default-color (of a Line-object):
Code: Select all
SetProperty "Commenting.Line.Styles[...].SColor", vDataIn
-
- Site Admin
- Posts: 2448
- Joined: Thu Jun 30, 2005 4:11 pm
Re: How can I detect which Tooltype is seleted?
What means " seleted (unknown) object"? It is about annotation-object on the page?Dorwol wrote: ...how can I change a property of a seleted (unknown) object by code?
You wanted to change properties of focused annotation? or to change current tool style?
PDF-XChange Co. LTD (Project Developer)
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
-
- User
- Posts: 275
- Joined: Mon Aug 04, 2008 5:04 pm
Re: How can I detect which Tooltype is seleted?
Sorry for my bad english!Vasyl-Tracker Dev Team wrote: What means " seleted (unknown) object"? It is about annotation-object on the page?
You wanted to change properties of focused annotation? or to change current tool style?
With "Unknown" I mean only, that my Code don't know (because can't detect!) the object-type.
And yes, I want to change properties of focused annotation.

-
- User
- Posts: 664
- Joined: Tue Nov 14, 2006 12:23 pm
Re: How can I detect which Tooltype is seleted?
For now you cannot do this because when Viewer AX lost focus (for example when you click on your controls) it also deselects focused annotation. In new build we will try to change this behaviour, so you can use "this.selectedAnnots;" JS method.
-
- User
- Posts: 275
- Joined: Mon Aug 04, 2008 5:04 pm
Re: How can I detect which Tooltype is seleted?
Not for me. My application will works well (no deselecting by click on any Command-Button-Click of my appliactions own toolbar!).Corwin - Tracker Sup wrote:For now you cannot do this because when Viewer AX lost focus (...) it also deselects focused annotation.
So if there is a way to do this, I'm already happy. But if not, when do you think is the release-date of the new build? This month?
Thank you
-
- User
- Posts: 664
- Joined: Tue Nov 14, 2006 12:23 pm
Re: How can I detect which Tooltype is seleted?
The Standard Window toolbars doesn’t take focus from the Viewer control, so if you are using only the toolbar buttons, you can try to detect what annotation is selected by using the following JS code:
HTH
Code: Select all
var aAnnots = this.selectedAnnots;
if (aAnnots.length>0)
aAnnots[0].type;
-
- User
- Posts: 275
- Joined: Mon Aug 04, 2008 5:04 pm
Re: How can I detect which Tooltype is seleted?
OK, good! But now...
...how can I change a property (like Color or Border) of a already seleted CommentTool-object by code?
For Example the user select a Line in his PDF and click on green-color-button in my toolbar (Line in PDF is still selected!). How can I set this to green?
Hope this is possible...
...how can I change a property (like Color or Border) of a already seleted CommentTool-object by code?
For Example the user select a Line in his PDF and click on green-color-button in my toolbar (Line in PDF is still selected!). How can I set this to green?
Hope this is possible...

-
- Site Admin
- Posts: 2448
- Joined: Thu Jun 30, 2005 4:11 pm
Re: How can I detect which Tooltype is seleted?
Code: Select all
var annots = this.selectedAnnots;
if (annots.length > 0)
{
annots[0].width = 10; // border width
annots[0].fillColor = color.green;
annots[0].strokeColor = color.green;
};
And also upgrade your distributive to version 42.4 prior to testing.
PDF-XChange Co. LTD (Project Developer)
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
-
- User
- Posts: 275
- Joined: Mon Aug 04, 2008 5:04 pm
Re: How can I detect which Tooltype is seleted?
If I use this Code, Undo and Redo does not work
Is this a bug or do I must call a Java-command like "AddUndoAction" or something else?
BTW: Because I develop normaly only in VB, allow me a question for a better understanding JavaScript-Actions in your Viewer-Control, will this always work? I mean does it also work if the user has no java-Engine in Windows installed or if the user has JavaScript disabled in your Preferences?
Is it planned to do the same by VB-Code (in next build or so...)?


Is this a bug or do I must call a Java-command like "AddUndoAction" or something else?
BTW: Because I develop normaly only in VB, allow me a question for a better understanding JavaScript-Actions in your Viewer-Control, will this always work? I mean does it also work if the user has no java-Engine in Windows installed or if the user has JavaScript disabled in your Preferences?
Is it planned to do the same by VB-Code (in next build or so...)?
-
- Site Admin
- Posts: 2448
- Joined: Thu Jun 30, 2005 4:11 pm
Re: How can I detect which Tooltype is seleted?
Because the many of edit-operation by JavaScript cannot be undone in current realization.
We will to add full undo-support to JS in the future.
Also we planning to add new edit-features without JS(but with full undo/redo) like as:
SetDocumentProperty(docId, "Selection[0].FColor", "red", 0);
SetDocumentProperty(docId, "Selection[0].SColor", "green", 0);
...
We will to add full undo-support to JS in the future.
Also we planning to add new edit-features without JS(but with full undo/redo) like as:
SetDocumentProperty(docId, "Selection[0].FColor", "red", 0);
SetDocumentProperty(docId, "Selection[0].SColor", "green", 0);
...
PDF-XChange Co. LTD (Project Developer)
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
-
- Site Admin
- Posts: 2448
- Joined: Thu Jun 30, 2005 4:11 pm
Re: How can I detect which Tooltype is seleted?
Please do not confuse/mix the terminology - Java and JavaScript - these are two different technologies.it also work if the user has no java-Engine in Windows installed or if the user has JavaScript disabled in your Preferences?
To support JavaScript, The Viewer does not require any additional products - everything required is already built-in.
And yes, it works when JavaScript execution is disabled by the user in the Preferences.
PDF-XChange Co. LTD (Project Developer)
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
-
- User
- Posts: 275
- Joined: Mon Aug 04, 2008 5:04 pm
Re: How can I detect which Tooltype is seleted?
BIG THX 4 feedback!

Oh, that sounds realy good. But I think, this new edit-features will not implemented before december, OR?Vasyl-Tracker Dev Team wrote:Also we planning to add new edit-features without JS(but with full undo/redo) like as:
SetDocumentProperty(docId, "Selection[0].FColor", "red", 0);
SetDocumentProperty(docId, "Selection[0].SColor", "green", 0);
...

-
- Site Admin
- Posts: 5223
- Joined: Tue Jun 29, 2004 10:34 am
Re: How can I detect which Tooltype is seleted?
We cannot be more specific at this time I am afraid.
Thanks for your patience.
Thanks for your patience.
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.
Best regards
Tracker Support
http://www.tracker-software.com
Best regards
Tracker Support
http://www.tracker-software.com