[Bug]: Text Selection Appears to Still be Somewhat Broken? #19528
Unanswered
wuxialearn
asked this question in
Q&A
Replies: 1 comment
-
I suggest trying to put some breakpoints in the event listeners in pdf.js/web/text_layer_builder.js Line 191 in e3ea926 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Attach (recommended) or Link to PDF file
http://cslabcms.nju.edu.cn/problem_solving/images/9/9a/Go_To_Statement_Considered_Harmful.pdf (or any PDF with text)
Web browser and its version
Firefox 135
Operating system and its version
Windows
PDF.js version
4.10.38
Is the bug present in the latest PDF.js version?
Yes
Is a browser extension
No
Steps to reproduce the problem
I see text selection flickering was fixed in #17923 (see also #9843). On version v4.10.38 I'm still seeing this issue on Firefox:
Here's the code I'm using (full example):
CLICK code
This is based on Peter Murwa's article just ported to the new text layer API. The built in Firefox pdfjs viewer works much better in this regard, so I think I may just be missing something.
What is the expected behavior?
Videos:
My code:
Screen.Recording.2025-02-20.212127.mp4
Firefox built in viewer:
Screen.Recording.2025-02-20.212208.mp4
What went wrong?
I hope it's clear how they are behaving differently. In my code when you go off a selection it selects the entire previous section of the page. In the built in version it maintains the current selection. I'd like to know how to achieve that behavior. The issue is worse when you have multiple single line paragraphs, where each time you move to a new paragraph in the selection it flickers between selecting normally and selecting the previous sections. I can give a better example if it isn't so visible with this PDF
Link to a viewer
No response
Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions