Closed bhaskargoyal closed 3 years ago
This has improved quite a bit after #7879, but it's not perfect yet.
I just have noticed the same problem while trying to figure out how to use search param.
You can reproduce it with the currently deployed demo (use 1.6.47?) : https://mozilla.github.io/pdf.js/web/viewer.html#search=Specialization
Most of occurances are ok but a few of them it looks like the hightlight is off by one character (in Chrome and Firefox, it seems to be ok in Explorer).
Edit : I wanted to show the issue to a coworker and the problem is not visible on his computer using the very same version of Chrome (55.0.2883.87), browser zoom at 100%. So I will attach a image a exemple of what I see on my computer, see the second occurance at the bottom of the image :
Side note :
This is not the case with the "Trace-based... " pdf sample but I have observed other hightlight shift (vertical by exemple) but these cases seems to be result of the OCR technology that was used to scan the source images of books (so really no much that can be done as it's impossible for the OCR to reproduce the font in all case).
In this sample, we can also see the shift visible in Adobe Acrobat Native (the ghosting of text in PDF.js in the right sample is another indirectly related issue and occur when we use the browser text search instead of pdf.js text search) :
Hi, Is anyone looking at this issue? This issue becomes more apparent if font is changed to MS Gothic. I searched for word "the" and selected highlight all. Below is the screen shot showing results
I had the same problem. I set 'text-spacing' to 'initial' of textLayer class in order to be sure text is not extended. It works well for me
This issue still persists for online demo.
Closing since this is fixed after recent search and text layer fixes.
Link to PDF file (or attach file here): online demo
Configuration:
Steps to reproduce the problem:
What is the expected behavior? (add screenshot) Expected behavior should be to highlight the searched text without any misalignment.
What went wrong? (add screenshot)
Issue related to the sreenshot
You can see that as the x coordinate increases within the page, the selected text "the" and the highlighted one, gets further apart. As if it is a function of x coordinate.