Any text selected and copied from a PDF document in evince, both via Ctrl-C and the right-click menu, gets a newline appended at the end when pasted into another program. Happens with every single pdf document that I have tried. As discussed downstream in: https://bugs.gentoo.org/show_bug.cgi?id=402071 This seems to be caused by poppler-0.18.3 and can be fixed with the following patch: https://bugs.gentoo.org/show_bug.cgi?id=402071#c5
Are you saying this is new behaviour in poppler 0.18.3? Have you verified your patch does not change pdftotext output?
From downstream report: > 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.
Not cairo backend related (TextSelectionDumper is only used by it but that doesn't mean it is cairo backend exclusive).
Carlos since it mostly affects the glib frontend (it's the only user of the TextSelectionDumper stuff) i'll leave it for you
I checked acroread and it does not append a newline to the last line of copied text. I've tested the patch linked to in comment 0 and it fixes the problem. Carlos indicated on irc he has no objection to pushing the patch. Patch pushed.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.