Re: PDW widget: get the rect of the hilitedRange

2022-01-11 Thread Monte Goulding via use-livecode
I think we would need to add a new property for that. Quite feasible as we 
already need to determine rects of the halite text to draw the selection. 
Perhaps create an enhancement request for this?

Cheers

Monte

> On 11 Jan 2022, at 9:19 am, Keith Clarke via use-livecode 
>  wrote:
> 
> Hi folks,
> Please can anyone advise how to get the rendered rectangle of highlighted 
> text in the PDF widget…?
> 
> I can successfully get the first word from the page text using something like:
> put pPageNum into tHilitedArray["from"]["page”] // = 1
> 
> put pPageNum into tHilitedArray["to"]["page”] // = 1
> put the length of word tWordNum of pPageText into tWordLength // = ‘3’ as the 
> word is “the"
> 
> put tWordIndex into tHilitedArray["from"]["index”] // = 1
> 
> put tWordIndex + tWordLength -1 into tHilitedArray["to"]["index”] // = 3
> set the hilitedRange of control "PDF1" to tHilitedArray
> 
> put the hilitedRangeText of control "PDF1" into tText // = “the"
> 
> 
> However, when I attempt to get the rendered rect of this word, to compare 
> with namedDestinations in the page ... 
> put the rectangle of the hilitedRange of control "PDF1" into tRect // returns 
> (Chunk: error in object expression) near “the”...
> 
> I’ve tried using the hilitedRangeText but get similar errors. 
> Any clues?
> TIA
> Keith
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


PDW widget: get the rect of the hilitedRange

2022-01-10 Thread Keith Clarke via use-livecode
Hi folks,
Please can anyone advise how to get the rendered rectangle of highlighted text 
in the PDF widget…?

I can successfully get the first word from the page text using something like:
put pPageNum into tHilitedArray["from"]["page”] // = 1

put pPageNum into tHilitedArray["to"]["page”] // = 1
put the length of word tWordNum of pPageText into tWordLength // = ‘3’ as the 
word is “the"

put tWordIndex into tHilitedArray["from"]["index”] // = 1

put tWordIndex + tWordLength -1 into tHilitedArray["to"]["index”] // = 3
set the hilitedRange of control "PDF1" to tHilitedArray

put the hilitedRangeText of control "PDF1" into tText // = “the"


However, when I attempt to get the rendered rect of this word, to compare with 
namedDestinations in the page ... 
put the rectangle of the hilitedRange of control "PDF1" into tRect // returns 
(Chunk: error in object expression) near “the”...

I’ve tried using the hilitedRangeText but get similar errors. 
Any clues?
TIA
Keith
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode