We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Compare coordinates from Mouse Click to coordinates returned from PdfViewerControl.FindText

The bounding rectangles returned by PdfViewerControl.FindText are in document coordinates, and are independent of the size and position of the document display.

The coordinates obtained when capturing a Mouse Click are dependent of the size and position of the document display.

How do I compare these two coordinate systems to test for a Mouse Click that is inside a bounding rectangle?

5 Replies

US Uthistran S Syncfusion Team March 18, 2014 01:40 PM UTC

We can match the mouse coordinates to bounding rectangle returned from FindText in a MouseCLick event handler by the attached “work around” sample.

Run this sample, and double click over “spine” in the title, if the mouse position is inside the coordinates of “Spine”, then we will get a message box.

Please, let us know whether this above sample suits your requirement.


Uthistran S.

Attachment: Sample_23974e02.zip

CB Chuck Berg March 18, 2014 06:28 PM UTC

The sample does not work at all.  No matter where I click, I never see the message box.

US Uthistran S Syncfusion Team March 20, 2014 12:58 PM UTC

Hi Chuck,
Thank you for your update.
Please, run the work around sample and "double - click" over "Spine" in the Title, a message box will get displayed.
Attached the screenshot image that displays a Messagebox on double clicking "Spine" for your reference.
Please, let us know if you need any further assistance.
Uthistran S.

Attachment: Capture_98c0b2c9.zip

CB Chuck Berg March 20, 2014 03:58 PM UTC

I've run your code, and stepped through it with the debugger, and the mouse coordinates do not match the bounding box for the work "Spine" in the title.  I have several patches installed from incidents 119486 and 119292 - perhaps that is having an impact.

US Uthistran S Syncfusion Team March 25, 2014 01:16 PM UTC

Hi Chuck,

 Thank you for your update.

We have updated the details about this forum in your incident #119486. Could you please follow the incident for the details on this?


Uthistran S.

Live Chat Icon For mobile
Up arrow icon