-
Notifications
You must be signed in to change notification settings - Fork 10k
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
Bug 810636 - Poor copy & paste behavior with pdf.js #2989
Comments
Actually the textLayer is build up from |
If we just changed all |
Correct, but we can add |
+1 for using |
Hi I am interested in fixing this issue ,can anyone mentor me to fix it ,where should I start looking in the code to start working on it? |
@SSk123 most of the text layer code is in |
I got the span working well but can't find the new line character. Is it getting trimmed somewhere earlier ? |
@rishib1988 Are you still working on this? If so and you need any help, you can always contact us using IRC. It would be nice to have this feature in PDF.js :) |
Hello. I am interested in fixing this issues. Could anyone help me? Where should I start to look? I will try to read |
@lpy I think @SSk123 is also working on this, but I'm not 100% sure. If you want help with this, the best thing to do is to contact us using the PDF.js IRC channel (irc.mozilla.org, #pdfjs). /cc @yurydelendik @SSk123 |
@lpy, good to see you are interested in fixing this issue, just wanted to make sure you are working on it, or else I would be happy to work on it :) |
Any update on this issue? We have to tell our customers use abode reader because of this problem. Copy/paste is a must have for us. |
Just did a short try and replaced
gets copied to a single line:
Note the missing space between "onlyfollows". PS: you can find my work here: jviereck@47b97bf |
There is also PR #4629, but work on that seems to have stopped. |
Closing since we now use |
See also Bug 810636 on Bugzilla: https://bugzilla.mozilla.org/show_bug.cgi?id=810636 for reference.
Basic problem: The textLayer is build up from multiple
<span>
elements. If the user selects text across multiple spans and copies the text, there is a newline insert between each span. However, it makes more sense (in most cases) to just insert a whitespace. Firefox has now support to change the clipboardData during the copy/cut event (background: https://bugzilla.mozilla.org/show_bug.cgi?id=407983).Implementation idea:
onCopy
andonCut
event listener to PDF.JSThis shouldn't be hard to implement and I have a plan for it bug lack the time to do it myself and make sure it lands properly.
Let me know if someone is interested in fixing this.
The text was updated successfully, but these errors were encountered: