mozilla / pdf.js

PDF Reader in JavaScript
https://mozilla.github.io/pdf.js/
Apache License 2.0
48.15k stars 9.95k forks source link

Unable to select highlighted text. #18190

Open atrinker opened 4 months ago

atrinker commented 4 months ago

Attach (recommended) or Link to PDF file here: 26805f2e-04d2-40af-978b-341d45fec3e8.pdf

Configuration:

Steps to reproduce the problem:

  1. Open attached file in the demo viewer.
  2. Attempt to select text within the highlighted paragraph.

What is the expected behavior? (add screenshot) You should be able to select text (e.g., for copying) from the highlighted paragraph

What went wrong? (add screenshot) You are unable to do so.

calixteman commented 4 months ago

It's a regression from #16899.

marco-c commented 4 months ago

18134 should make it easier to fix this.

atrinker commented 4 months ago

I wonder whether this might be tied into #16883, because the unexpected behavior only occurs with annotations that are "burnt in." See the screenshot below, where the red highlighting is newly added:

Screenshot 2024-05-31 at 09-29-31 26805f2e-04d2-40af-978b-341d45fec3e8-5 pdf

nicolo-ribaudo commented 4 months ago

Can those preexisting annotations have pointer-events: none?

omerarpacik commented 2 months ago

Hi, I'm looking for highlighting with pdfjs. As I see on screenshot, there is a tool for highlighting. How can add to my proejct?

shivaprsd commented 2 months ago

Setting this to none makes it possible to select the text again: https://github.com/mozilla/pdf.js/blob/2efa3e460c94ad6ad48541e2ec44af6e22153bda/web/annotation_layer_builder.css#L118

marco-c commented 1 week ago

I think this is now fixed.

marco-c commented 1 week ago

No actually not, now clicking on the highlighted text will select the whole highlighted area.