Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 402071 - app-text/poppler-0.18.3, all pdf viewer using poppler: copy adds a newline character
Summary: app-text/poppler-0.18.3, all pdf viewer using poppler: copy adds a newline ch...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GNOME (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Maciej Mrozowski
URL: https://bugs.freedesktop.org/show_bug...
Whiteboard:
Keywords: PATCH
: 403229 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-02-03 15:09 UTC by Horst Prote
Modified: 2012-04-05 20:01 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch for poppler-0.18.3 (poppler-0.18.3-copy-adds-newline.patch,388 bytes, patch)
2012-02-12 14:17 UTC, Horst Prote
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Horst Prote 2012-02-03 15:09:39 UTC
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.
Comment 1 Pacho Ramos gentoo-dev 2012-02-03 19:57:12 UTC
If it's still valid with evince-3, please report directly to upstream -> bugzilla.gnome.org
Comment 2 Alexandre Rostovtsev (RETIRED) gentoo-dev 2012-02-03 22:59:18 UTC
(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
Comment 3 Horst Prote 2012-02-12 02:43:38 UTC
epdfview (Bug 403229) and mupdf (Bug 403231) have the same problem.
Comment 4 Pacho Ramos gentoo-dev 2012-02-12 10:40:15 UTC
Maybe a poppler bug then? :/
Comment 5 Horst Prote 2012-02-12 14:17:56 UTC
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.
Comment 6 Horst Prote 2012-02-12 14:22:04 UTC
I changed the subject to make clear it's a poppler bug.
Comment 7 Horst Prote 2012-02-12 14:23:18 UTC
*** Bug 403229 has been marked as a duplicate of this bug. ***
Comment 8 Pacho Ramos gentoo-dev 2012-02-12 17:00:30 UTC
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
Comment 9 Pacho Ramos gentoo-dev 2012-02-13 09:43:00 UTC
(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
Comment 10 Horst Prote 2012-02-13 23:22:55 UTC
(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.
Comment 11 Andreas K. Hüttel archtester gentoo-dev 2012-04-05 20:01:34 UTC
Patch added to poppler-0.18.4-r1 (has been accepted upstream, too)