TextHighlightAnnotation do not highlight text from different pages, only when text is selected from view mode, the group ungroup pops and annotation can be created on both pages

Which product are you using?

PDF.js Express Plus
PDF.js Express Version

8.7.0

Detailed description of issue
TextHighlightAnnotation do not highlight text from different pages, only when text from consecutive pages is selected from view mode, the group ungroup option pops and an annotation can be created on consecutive pages.

Expected behaviour

Current behaviour on annotate mode

Unable to highlight text from the next page!!

Does your issue happen with every document, or just one?
all documents

Link to document
any online document

Code snippet
I have tried Tools.Tool.allowAnnotationsOutsidePage(); doesn’t work

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:

Share how you are using PDF.js Express in your organization you could win a $500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free. Learn more here

Hi ons.othmen,

Thanks for contacting pdf.js express forums,

This is not possible, due to the PDF Specfication.
You can read about the related forum post here:Draw one line between mulitple pages

You do have the option to select using the tool’s API:
https://pdfjs.express/api/Core.Tools.TextHighlightCreateTool.html#select

Best Regards,
Kevin Kim


Share how you are using PDF.js Express in your organization you could win a $500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free. Learn more here

Hi Kkim,

Thank you for your fast reply, annotating on consecutive pages is important as part of our evidence collection process as a piece of evidence can be spanned on multiple pages and you actually already support it on view mode; the group ungroup button is displayed once text is selected on different pages, so it is possible, but not on annotate mode, we actually need this feature on annotate mode when we click on the text highlight button and we will be more than happy if you support it as soon as possible.

Thanks!

Hi there,

Thank you for your response,

Yes indeed it looks like it is supported but do note that each page has its own annotation:

We’ve added the issue to our backlog to be worked on in the future. We don’t have a timeline for when it will be fixed but if it does get fixed we’ll let you know when it’s available in an experimental build to test out and the estimated official release date. If you have a desired timeline for having this issue fixed please let us know and we’ll do our best to work with you on how this can fit into the release schedule.

Best Regards,
Kevin Kim


Share how you are using PDF.js Express in your organization you could win a $500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free. Learn more here

Hi Kkim,

Thanks for your fast reply and your cooperation, we will be more than happy to have this fix very soon, as we are already in the process of purchasing a license from you and planning a release very soon.

Best,
Ons.

Hi Kkim,

I am writing to follow up on the requested update above, what is the estimated timeline for the fix?

Best,
Ons.

Hi there,

Apologies for the delayed response,

We had some internal discussion regarding this topic and it is a bit more tricky for the implementation.

  • This request is more of a feature request due to our design following the PDF specification. As mentioned above, annotation mode is limited to one page due to how each annotation cannot have reference to multiple pages. Additionally, users can be confused to its behaviour, for example if they were to use the highlight annotation and click & drag across multiple pages without letting go of their mouse, our notes-panel will show multiple annotations which may confuse users as if they had accidentally let go of their mouse and re-click & dragged instead.

  • Due to the point above, our text selection mode that you see in ‘Viewing’ and all the annotation tools under the ‘Annotate’ tool-group are designed differently and would require non-trivial changes in our codebase.

  • A possible alternative would be to create another instance of the text-selection tool (PDFJS Express WebViewer Class: TextSelectTool) and then listen for the ‘selectionCompleted’ event. When the event triggers, you could add the annotations at the end. Customize PDF.js Express Viewer Annotations in Toolbar | Documentation
    Here is a forum post of our similar WebViewer product to potentially extract selectedText: Create multiple text selections - WebViewer - PDFTron Community

Please note that we don’t currently have this on our roadmap but we will add it to the backlog for our product team to review.

Thank you for your understanding.

Best Regards,
Kevin Kim
Web Development Support Engineer
PDFTron Systems, Inc.
www.pdftron.com


Share how you are using PDF.js Express in your organization you could win a $500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free. Learn more here