Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with selecting text spanning multiple pages #10516

Closed
dev-grant opened this issue Feb 3, 2019 · 4 comments
Closed

Issues with selecting text spanning multiple pages #10516

dev-grant opened this issue Feb 3, 2019 · 4 comments

Comments

@dev-grant
Copy link

dev-grant commented Feb 3, 2019

Problem occurs on all pdf files and viewer setups I've tested, including the demo: https://mozilla.github.io/pdf.js/web/viewer.html

Configuration:

  • Web browser and its version: Firefox 65.0
  • Operating system and its version: Windows 10
  • PDF.js version: Latest
  • Is a browser extension: No

Steps to reproduce the problem:

  1. Start selecting text on one page
  2. Keep selecting down to another page

What went wrong? (add screenshot)

  1. Text selection becomes offset to the cursor, making it impossible to select the end of a line of text (happens on firefox, but not IE or chrome):

pdfjs_li

  1. The enhanced textLayerMode (value 2) of the pdf viewer does not work on the subsequently selected pages (the text div expansion does not trigger). Text selection jumps to the top of the page when the cursor is in between lines of text. I noticed the on click text div transformations that occur with textLayerMode 2 don't occur on these subsequent pages, even though they do occur on the starting page's selection.

  2. When calling getSelection().getRangeAt(0).getClientRects() - the only rect counted as selected on subsequent pages is the entire page's div rect - as visualized by this picture, where the selection rects of the selection's starting page appear properly, but only 1 giant selection rect appears for the next page:
    2019-02-03 02_27_36-react app

Link to a viewer (if hosted on a site other than mozilla.github.io/pdf.js or as Firefox/Chrome extension):
Issue 1 can be seen here: https://mozilla.github.io/pdf.js/web/viewer.html. Issue 2 and 3 require a differently set up viewer, which I can put together an online viewer for if desired.

@burtonator
Copy link

This impacts our users too... https://getpolarized.io/

@aehlke
Copy link

aehlke commented May 16, 2023

ever find a workaround?

@limonovthesecond2
Copy link

The 1 issue no longer exists with PR#17923
The 2 issue is also seems to be fixed with the PR above as we can't accidentally select the empty space between the lines
The 3 issue seems outdated

@timvandermeij
Copy link
Contributor

Closing since this should be fixed indeed; thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants