Get the current position in pixel (or other units) of the selectionEnd event.

Hello,

I would like to get the current position in pixel (or other units) of the selectionEnd event. Ideally these
rectangle coordinates of my selection (2 points P1 (top left) and P2 (bottom,right)). Is it possible ? Or with an other event ?

@code {
public void selectionEnd(TextSelectionEndEventArgs args)
{

}
}

Thanks,
Nicolas

2 Replies 1 reply marked as answer

DM Dhivyabharathi Mohan Syncfusion Team March 10, 2021 09:34 AM UTC

Hi Nicolas, 
 
In our PDF Viewer, we can get the bounds of the selected position using the event OnTextSelectionEnd as like below code snippet. And we have shared the sample for your reference. 
 
 
Code snippet: 
 
<SfPdfViewer @ref="Viewer" DocumentPath="PDF_Succinctly.pdf" ServiceUrl="https://ej2services.syncfusion.com/production/web-services/api/pdfviewer" Height="500px" Width="1060px"> 
<PdfViewerEvents OnTextSelectionEnd="selectionEnd"></PdfViewerEvents> 
</SfPdfViewer> 
 
public void selectionEnd(TextSelectionEndEventArgs args) 
        { 
            Console.WriteLine(args.TextBounds); 
        } 
 
Kindly try this and revert to us, if you have any concerns about this. 
 
Regards, 
Dhivya. 
 


Marked as answer

NN Nicolas NOEL March 10, 2021 05:37 PM UTC


Hi Dhivya,

Ok Thanks

Loader.
Up arrow icon