hypothesis / pdf.js-hypothes.is

PDF.js + Hypothesis viewer / annotator
369 stars 72 forks source link

Annotation in wrong place #24

Open AJamesPhillips opened 2 years ago

AJamesPhillips commented 2 years ago

I have the chrome extension 1.926.0.0. When viewing a PDF with an annotation, the annotation appears in the wrong place. When searching for the annotation text, the text highlight position is wrong. When searching for the same text in Chrome's default PDF rendered or using Preview (Mac), the highlight for the searched for text appears in the correct position.

Search for "job polarisation" in the following PDF and it will look like the screenshot below. You can see if you try to annotate the text the actual text annotated is "forworkers perform":

image

robertknight commented 2 years ago

I can reproduce in our Chrome extension which is currently using PDF.js v2.11.213. Using the bookmarklet in Firefox's native PDF viewer with PDF.js v2.11.298, the problem does not appear.

I found this recent change in PDF.js that looks like it may be related - https://github.com/mozilla/pdf.js/pull/14209.