Text selection highlight is broken up

WebViewer Version: 8.9.0

I’m using Web Viewer 8.9.0 for React and I’m seeing an issue on some documents where the highlighting (either by selecting with a cursor or by searching) is not displaying correctly and is a little broken up. Interestingly, when I copy and paste the selection I can see the correct text, so this is just a visual issue with the highlighting. Please refer to the image for an example.

Is there something I’m doing wrong? Or is this possibly a bug?

Hi Mark,

Thank you for contacting us regarding Webviewer.

To further investigate the issue, could you provide us the following information?

  1. Steps to reproduce
  2. Documents/files that the issue can be reproduced (or the document shown in the screenshot)
  3. Could it be reproduced at the link: PDFTron WebViewer Demo: JavaScript PDF Viewer Demo or JavaScript PDF Viewer Demo
  4. Other related information

Thank you.

Hi Johnny,

Here’s a url for an example document that has a similar issue:
https://mark-pdftron-example.s3.ap-southeast-2.amazonaws.com/example.docx

Steps to reproduce:

  1. Open up the above docx file on the Web Viewer
  2. Click on the search button and enter the following search term : “Furthermore, Business Associate shall use PHI (i) solely for Covered Entity’s benefit and only for the purpose of performing services for Covered Entity as such services are defined in Business Arrangements”
  3. Click on the found search result and you will see the text highlighted incorrectly (See screenshot below)
    Screenshot 2022-11-03 at 2.37.59 PM

Regarding the 2 links you provided… Interestingly the highlighting looked fine on the first link - PDFTron WebViewer Demo: JavaScript PDF Viewer Demo but did not look correct on the second link JavaScript PDF Viewer Demo

I hope this is sufficient information. Please let me know if you need anything else.

Regards,
Mark Aziz

Hi Mark,

Thank you for providing the information.

The issue might sit under the conversion of the docx file.

While we’re currently looking into the issue, there’s a workaround using the loadAsPDF: true option in the Webviewer. The selection should be shown correctly with this option.

We will update you once we have further progress, thank you.

Hi Johnny,

Thanks for your reply. Unfortunately the “loadAsPDF” option is not an ideal solution for us. It does indeed fix the highlighting issue, but we noticed that it does not search correctly when a document (originally as a docx file) has 2 columns of text. It would be great if the highlighting was fixed without the need for “loadAsPDF”. Please keep me updated on this issue. Thanks.

Hi Mark,

This appears to be fixed. Opening the .docx file you sent us in the webviewer demo, I am able to highlight the text and search for the text without error.