How to detect if Ruler is showed?
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 to detect if Ruler is showed?
Hi,
short question.
For example with "36522" I can show Rulers, with "36520" I can show grid... adn so on...
But how can I get the state? I mean how can I detect, if the ruler is showed?
Is there any GetState(...) function available?
short question.
For example with "36522" I can show Rulers, with "36520" I can show grid... adn so on...
But how can I get the state? I mean how can I detect, if the ruler is showed?
Is there any GetState(...) function available?
-
- Site Admin
- Posts: 2445
- Joined: Thu Jun 30, 2005 4:11 pm
Re: How to detect if Ruler is showed?
Hi, Dorwol.
Use:
HTH
Use:
Code: Select all
int showRulers = 0;
pdfViewer.GetProperty("Measurement.Rulers.Visible", out showRulers, 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.
-
- User
- Posts: 275
- Joined: Mon Aug 04, 2008 5:04 pm
-
- Site Admin
- Posts: 19885
- Joined: Mon Jan 12, 2009 8:07 am
-
- User
- Posts: 275
- Joined: Mon Aug 04, 2008 5:04 pm
Re: How to detect if Ruler is showed?
Sorry, but is there any documentation about this available?
In the Help-PDF I can not find something about this and it look like a little "BlackBox" for me.
Now I have the same problem with HighlightTextTool, CrossOutTextTool, ...
I have already try out "Commenting.Underline.visible" and also "Tools.Underline.visible"...
...but all without any success!
In the Help-PDF I can not find something about this and it look like a little "BlackBox" for me.
Now I have the same problem with HighlightTextTool, CrossOutTextTool, ...
I have already try out "Commenting.Underline.visible" and also "Tools.Underline.visible"...
...but all without any success!

-
- Site Admin
- Posts: 19885
- Joined: Mon Jan 12, 2009 8:07 am
Re: How to detect if Ruler is showed?
Hello Dorwol,
The rulers could be visible or not, but the HighlightTextTool and CrossOutTextTool can be selected (and active) or not. They can't be "visible" in the same way as the rulers.
Have you tried the Tools.Active - which should return the ID of the currently selected tool - you can find the IDs in the table under section 2.2.3.63 Tools in the Viewer AX Manual.
Best,
Stefan
The rulers could be visible or not, but the HighlightTextTool and CrossOutTextTool can be selected (and active) or not. They can't be "visible" in the same way as the rulers.
Have you tried the Tools.Active - which should return the ID of the currently selected tool - you can find the IDs in the table under section 2.2.3.63 Tools in the Viewer AX Manual.
Best,
Stefan
-
- User
- Posts: 275
- Joined: Mon Aug 04, 2008 5:04 pm
Re: How to detect if Ruler is showed?
Yes, I know "Tools.Active".Tracker Supp-Stefan wrote:Have you tried the Tools.Active - which should return the ID of the currently selected tool - you can find the IDs in the table under section 2.2.3.63 Tools in the Viewer AX Manual.
But the result is a number and not a String value.
The problem is, for "KeepSelect" I need a name (like "Tools.Highlight" or "Tool.StrikeOut") of the tool, for "ExecuteCommand" I need a different name (like "HighlightTextTool" or "CrossOutTextTool") and now, I need also a number value for checking?
That's really hard and not well good

This szenario makes my source good bad for reading/understanding...!
So my question is now, is there a way to KeepSelect and ExecuteCommand with the same number like for Tools.Active?
For example, something like this (pseudo-code):
SetProperty "Tools.[33222].KeepSelected", 1
DoVerb , "", "ExecuteCommand", 33222
? GetProperty("Tools.Active") ...result is... = 33222
---------> That would be a uniform code!
-
- Site Admin
- Posts: 19885
- Joined: Mon Jan 12, 2009 8:07 am
Re: How to detect if Ruler is showed?
Hello Dorwool,
I haven't tried that myself, but it shouldn't be a problem to use the tool ID all the time
//pseudocode
SetProperty("Tools.Active", 33222, 0);
SetProperty("Tools.[33222].KeepSelected", 1, 0);
And then calling
GetProperty ("Tools.Active") should also return to you the expected result -> 33222
Best,
Stefan
I haven't tried that myself, but it shouldn't be a problem to use the tool ID all the time
//pseudocode
SetProperty("Tools.Active", 33222, 0);
SetProperty("Tools.[33222].KeepSelected", 1, 0);
And then calling
GetProperty ("Tools.Active") should also return to you the expected result -> 33222
Best,
Stefan
-
- User
- Posts: 275
- Joined: Mon Aug 04, 2008 5:04 pm
Re: How to detect if Ruler is showed?
> SetProperty("Tools.Active", 33222, 0);
Works wonderful!!!
> SetProperty("Tools.[33222].KeepSelected", 1, 0);
Doesn't work. I've also tried ...Tools.[#33222].KeepSelected....
Any hint? We are short before the goal!
Works wonderful!!!
> SetProperty("Tools.[33222].KeepSelected", 1, 0);
Doesn't work. I've also tried ...Tools.[#33222].KeepSelected....
Any hint? We are short before the goal!
-
- Site Admin
- Posts: 19885
- Joined: Mon Jan 12, 2009 8:07 am
Re: How to detect if Ruler is showed?
Hello Dorwool,
I am afraid that you will need to use the tool name when you want it to be kept selected.
Best,
Stefan
I am afraid that you will need to use the tool name when you want it to be kept selected.
Best,
Stefan
-
- User
- Posts: 275
- Joined: Mon Aug 04, 2008 5:04 pm
Re: How to detect if Ruler is showed?
Oh, that's bad.Tracker Supp-Stefan wrote:I am afraid that you will need to use the tool name when you want it to be kept selected.
Is there a function to get the "Tool Name" from an ID?
Like...
? GiveToolNameFromID(33222) ...result is... = "Underline"
If yes, I have all what I do need.
-
- Site Admin
- Posts: 2445
- Joined: Thu Jun 30, 2005 4:11 pm
Re: How to detect if Ruler is showed?
Hi, Dorwol.
You have:some equivalents for this:
and for get active tool ID:
And your:
"Tools.[33222].KeepSelected"
"Tools.[#33222].KeepSelected"
- are somewhat wrong. The correct one is:
"Tools.Underline.KeepSelected"
HTH
You have:
Code: Select all
pdfViewer.SetProperty("Tools.Active", 33222, 0); // 33222 - is "UnderlineTextTool" UI-command
Code: Select all
pdfViewer.SetProperty("Tools.Active", "Underline", 0);
pdfViewer.SetProperty("Tools.Active", "UnderlineText", 0);
pdfViewer.SetProperty("Tools.Active", "UnderlineTextTool", 0);
Code: Select all
int activeToolID = 0;
pdfViewer.SetProperty("Tools.Active", out activeToolID, 0);
or:
string activeToolName;
pdfViewer.SetProperty("Tools.Active", out activeToolName, PXCVA_GetNamed); // will return the "Underline" string in case above
"Tools.[33222].KeepSelected"
"Tools.[#33222].KeepSelected"
- are somewhat wrong. The correct one is:
"Tools.Underline.KeepSelected"
HTH
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 to detect if Ruler is showed?
Thank you, but believe me. It doesn't work!Vasyl-Tracker Dev Team wrote:- are some wrong. The correct:
"Tools[#33222].KeepSelected"


-
- Site Admin
- Posts: 19885
- Joined: Mon Jan 12, 2009 8:07 am
Re: How to detect if Ruler is showed?
Hello Dorwool,
Vasyl corrected this in his post - you were just too fast to read the initial version.
Unfortunately Tools is not an array object - so yes Tools[#33222] is indeed incorrect and will not work.
The only proper way is to use Tools.Underline.KeepSelected in this particular case and change the tool name accordingly for other tools.
The consistent solution would be what Vasyl offered - with using the actual tool names and not the IDs.
Best,
Stefan
Vasyl corrected this in his post - you were just too fast to read the initial version.

Unfortunately Tools is not an array object - so yes Tools[#33222] is indeed incorrect and will not work.
The only proper way is to use Tools.Underline.KeepSelected in this particular case and change the tool name accordingly for other tools.
The consistent solution would be what Vasyl offered - with using the actual tool names and not the IDs.
Best,
Stefan
-
- User
- Posts: 275
- Joined: Mon Aug 04, 2008 5:04 pm
Re: How to detect if Ruler is showed?
> Vasyl corrected this in his post - you were just too fast to read the initial version
Oh yes, I see.
Thank you!
Oh yes, I see.
Thank you!
-
- Site Admin
- Posts: 7362
- Joined: Wed Mar 25, 2009 10:37 pm
Re: How to detect if Ruler is showed?

Best regards
Paul O'Rorke
PDF-XChange Support
http://www.pdf-xchange.com
Paul O'Rorke
PDF-XChange Support
http://www.pdf-xchange.com