Create multiple text selections

WebViewer Version:
8.2.0

Please give a brief summary of your issue:
No issue, just a question. Is there a way to allow for multiple text selections or not clear the current selection when a new one is made?

Please describe your issue and provide steps to reproduce it:
A user is trying to select text across two pages, however the footer of the first page and header of the second page are being included in the text selection and subsequent quads. How can I either allow multiple text selections or make it so that the header and footer are not part of the text selection for a multi-page selection?

Please provide a link to a minimal sample where the issue is reproducible:
N/A

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:APIs:Forums:

Hi there,

At the moment, the default text select tool does not support multi-section text selection. However it might be possible to create this functionality by making use of the text highlight tool and several other methods as the text highlight tool is able to create multiple text highlight annotations.

But we need to be careful that users might already have / want to create highlight annotations where they actually need it, so it would be wise for us to use some “special conditions” when creating the highlight annotations for our specific purpose, such as only when pressing a specific function key (Ctrl / Shift etc). The steps in general are:

  • We listen to the ‘annotationChanged’ event. Once the user creates a text highlight annotation and if it satisfies our “special condition”, we programmatically select the annotation while keeping all the previously selected text highlight annotations, if any.
  • We also need to listen to keyboard event. When the user hits Ctrl+C, we obtain all the currently selected highlight annotations with annotationManager.getSelectedAnnotations()
  • From these annotations, we will be able to access the PageNumber property and the getQuads() method to obtain the coordinates of the highlighted area.
  • We can then loop through all the Quads+PageNumber and use these 2 methods - documentViewer.select() & documentViewer.getSelectedText() to retrieve all the text under the highlighted areas.
  • After retrieving the text, we remove all the currently selected annotations.