PDF-XChange - Tracker PDF Viewer - TIFF-XChange - Image-XChange - XMF-XChange - Raster-XChange - Support

Moderators: Tracker Support, TrackerSupp-Daniel, Paul - Tracker Supp, Chris - Tracker Supp, Vasyl-Tracker Dev Team, Ivan - Tracker Software, Sean - Tracker, Tracker Supp-Stefan

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
 
DolphinMann
User
Topic Author
Posts: 108
Joined: Mon Aug 04, 2014 7:34 pm

Selected Text - Value & Coordinates

Thu Nov 23, 2017 6:08 pm

I have used the search function for the forums and found many related topics, but nothing that seemed to answer or provide actual guidance on where to go for this....

How do I get the selected Text Value and Coordinates on a document?

Even using the DEMO app for instance. I can select text on the form and it properly highlights. I can then see the "Inst.ActiveDoc.ActiveSel" object has some properties that tell me a little about it, copy/paste etc. It also has a ClusterID and normal ID.

But I do not see any way to go from that selection to actual string values or X,Y,Width,Height coordinates. Though if I had the Value and starting X/Y I can calculate the text characters coordinates from the GetPageTextFunction.

In short :) I am just trying to figure out what a user is selecting within the application as it relates to the PageText
 
DolphinMann
User
Topic Author
Posts: 108
Joined: Mon Aug 04, 2014 7:34 pm

Re: Selected Text - Value & Coordinates

Thu Nov 23, 2017 8:07 pm

Update:

I have found that I can cast the selection as a TextSelection, if indeed it is, which I have confirmed it is: http://sdkhelp.tracker-software.com/vie ... tSelection

However I still cannot find any information on where or what the text is location.
 
DolphinMann
User
Topic Author
Posts: 108
Joined: Mon Aug 04, 2014 7:34 pm

Re: Selected Text - Value & Coordinates

Thu Nov 23, 2017 8:12 pm

Sorry for the thread spam. This was an immediate problem....

I think I found what I wanted in this thread: viewtopic.php?f=66&t=28988&p=116010&hilit=selection+IPXV_TextSelection#p116010

I needed to get the TextSelection and then get the PageTextSelection. From there it seems I can get the chars, including their indices which I can then of course map to the page.gettext stuff.
 
User avatar
Sasha - Tracker Dev Team
User
Posts: 2796
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Selected Text - Value & Coordinates

Fri Nov 24, 2017 12:41 pm

Hello DolphinMann,

Great that you have found that - from what I remember, there are several topics on this matter - I'm sure you can pretty much find what you need there.

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
 
DolphinMann
User
Topic Author
Posts: 108
Joined: Mon Aug 04, 2014 7:34 pm

Re: Selected Text - Value & Coordinates

Mon Dec 04, 2017 3:54 pm

Is there a way to get which Content Items are selected, instead of just text?
 
User avatar
Sasha - Tracker Dev Team
User
Posts: 2796
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Selected Text - Value & Coordinates

Tue Dec 05, 2017 8:35 am

Hello DolphinMann,

Of course, you will have to get an appropriate selection for this:
selection.contentItems
And get the https://sdkhelp.tracker-software.com/vi ... sSelection by this ID in the selChanged event.

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

Who is online

Users browsing this forum: No registered users and 1 guest