Let me cite from the same bug on launchpad (https://bugs.launchpad.net/ubuntu/+source/evince/+bug/792076): Copy paste from a PDF document using evince results in the addition of a newline character to the end of the pasted text. This is possibly seen as a convenient feature, but in reality more often than not results in the need to delete the new line. There it was closed because it was not reproducable on ubuntu-11 which ships evince 3.2.0, so I tried the latest in the gentoo tree: app-text/evince-3.2.1-r1 but the problem remains. Reproducible: Always Steps to Reproduce: 1. Open a PDF in evince. 2. Select some word. 3. Paste it somwhere Actual Results: The pasted text is altered with the addition of a new line. Expected Results: Copying and pasting text from a PDF document should result in the text selected from the PDF being included in the new location without alteration.
If it's still valid with evince-3, please report directly to upstream -> bugzilla.gnome.org
(In reply to comment #1) > If it's still valid with evince-3, please report directly to upstream -> > bugzilla.gnome.org It is indeed valid with evince-3.2.1-r1. Upstream bug filed at https://bugzilla.gnome.org/show_bug.cgi?id=669351
epdfview (Bug 403229) and mupdf (Bug 403231) have the same problem.
Maybe a poppler bug then? :/
Created attachment 301655 [details, diff] Patch for poppler-0.18.3 mupdf doesn't use poppler but for evince and epdfview you are right. This patch for poppler-0.18.3 works for me: At the very end of the selection no newline is added now. But if one selects multiple lines of text it still adds newlines at the end of all lines but the last one.
I changed the subject to make clear it's a poppler bug.
*** Bug 403229 has been marked as a duplicate of this bug. ***
Reopening (to get it solved in the tree) and reassigning to poppler maintainers, anyway, would be better to send a bug with your patch to poppler upstream -> bugzilla.freedesktop.org Thanks a lot for the patch
(In reply to comment #5) > Created attachment 301655 [details, diff] [details, diff] > Patch for poppler-0.18.3 > > mupdf doesn't use poppler but for evince and epdfview you are right. > > This patch for poppler-0.18.3 works for me: > At the very end of the selection no newline is added now. > But if one selects multiple lines of text it still adds newlines at the end of > all lines but the last one. Can you reply to upstream questions from: https://bugs.freedesktop.org/show_bug.cgi?id=45955#c1 ? Thanks
(In reply to comment #9) > Can you reply to upstream questions from: > https://bugs.freedesktop.org/show_bug.cgi?id=45955#c1 > ? The two questuons from upstream: > Are you saying this is new behaviour in poppler 0.18.3? No. As far as I can see the relevant part of TextOutputDev.cc is the same in poppler-0.16.7. The behavior is new to me only because I solely used xpdf over the last decade and even the 'popplerized' xpdf in gentoo is not affected (I think it doesn't use poppler for text copying). > Have you verified your patch does not change pdftotext output? I just did a pdftotext of two pages of an pdf document with and without my patch applied and diff says the output is identical. And I'm very confident that this will always be ok as my change is in function TextSelectionDumper::getText which as far as I can see is not used by pdftotext.
Patch added to poppler-0.18.4-r1 (has been accepted upstream, too)