Skip to main content
Participant
June 5, 2024
Question

Add annotation upon PREVIEW_SELECTION_END

  • June 5, 2024
  • 0 replies
  • 185 views

I'm having trouble programmatically adding a highlight annotation automatically after the user selects a piece of text in the pdf.

I believe my program should listen for PREVIEW_SELECTION_END event, takes the event data, which has bounding box information, before using it as the quad points of the new highlight annotation. I realized the bbox information cannot be directly used and must be converted (subtracting deviceTop/Bottom fields of selection bbox from screen height to get bounding boxes for annotation? not really working...) , and I couldn't find information on the bbox fields of PREVIEW_SELECTION_END event.  

How are the two representations of bounding boxes (text selection v.s. annotation) different? 

What's the proper way to convert them?  
 

 

 

This topic has been closed for replies.