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

PDFViewer - Text Selection

Morning - 

  1. how can I programatically tell if the user can select text (ie the document will yield text if the user attempts to select text)?
  2. how can I disable - enable when a user is permitted to select text using the mouse (and thereby prevent highlighting it if disabled) ?
  3. how can I programatically get the text selected by the user outside of the TextSelectionCompleted event?
  4. how can I programatically reset the text selected by the user (ie unhighlight and clear selection)?
  5. how can I programatically replace the contextmenu that shows when the user selects text (I know I can use EnableContextMenu to hide the built in context menu - but I want to replace it and implement my own copy method)?
Would be grateful for a prompt response to these queries.

Regards

Darrin

2 Replies

DG Deepak Gunasekaran Syncfusion Team February 11, 2019 12:54 PM UTC

Hi Darrin, 
 
We are currently working on analyzing to achieve the requirements from sample level using our existing customization support. We will update more details regarding this on 12th February 2019. 
 
Regards, 
Deepak G 



SS Sathish Sivakumar Syncfusion Team February 26, 2019 12:16 PM UTC

Hi Darrin, 
 
Please find the details from the below table. 
 
  1. how can I programatically tell if the user can select text (ie the document will yield text if the user attempts to select text)?
  2. how can I programatically get the text selected by the user outside of the TextSelectionCompleted event?
  3. how can I programatically replace the contextmenu that shows when the user selects text (I know I can use EnableContextMenu to hide the built in context menu - but I want to replace it and implement my own copy method)?
  
We have prepared sample to meet your requirement and attached the sample for your reference. Kindly try running the sample and let us know whether it helps you? 
Sample link: 
  
  1. how can I disable - enable when a user is permitted to select text using the mouse (and thereby prevent highlighting it if disabled) ?
  2. how can I programatically reset the text selected by the user (ie unhighlight and clear selection)?
  
At present PdfViewer does not support disabling text selection and to reset the selected text programmatically. We have logged feature report for the requirement and it will included in any of our upcoming releases. 
 
  
Regards, 
Sathish 


Loader.
Live Chat Icon For mobile
Up arrow icon