Bug 401044 - When "copying and pasting": Okular prints line breaks that don't really exist, and therefore some lines are "broken" :(
Summary: When "copying and pasting": Okular prints line breaks that don't really exist...
Status: CONFIRMED
Alias: None
Product: okular
Classification: Applications
Component: PDF backend (show other bugs)
Version: 1.4.3
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords: investigated, triaged
Depends on:
Blocks:
 
Reported: 2018-11-14 20:02 UTC by Ganton
Modified: 2023-04-12 14:30 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
A PDF file that can be used to see the bug (17.92 KB, application/pdf)
2018-11-14 20:02 UTC, Ganton
Details
The source file that can be used to create the pdf file that was attached previously (29.03 KB, application/vnd.oasis.opendocument.text)
2018-11-14 20:04 UTC, Ganton
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ganton 2018-11-14 20:02:20 UTC
Created attachment 116312 [details]
A PDF file that can be used to see the bug

SUMMARY

When "copying and pasting": Okular prints line breaks that don't really exist, and therefore some lines are "broken" :(

There are problems copying and pasting from a PDF file to e.g. a text editor, or a terminal emulator. I attach the PDF file, and the ODT source file. The problem doesn't happen using Adobe Acrobat.


STEPS TO REPRODUCE

1. Open the pdf file.
2. Copy the text.
3. Paste the text in a text editor.


OBSERVED RESULT (the text after copying and pasting from the PDF file to a text editor or a terminal emulator)

ZERO*)
echo "0";;
*ONE\
TWO\ *) echo "1 2" ;;
*ONE\
THREE\ *) echo "1 3" ;;
*ONE\
FOUR\ *) echo "1 4" ;;
ONE*)
echo "1" ;;


EXPECTED RESULT

ZERO*) echo "0";;

*ONE\ TWO\ *) echo "1 2" ;;
*ONE\ THREE\ *) echo "1 3" ;;
*ONE\ FOUR\ *) echo "1 4" ;;
ONE*) echo "1" ;;


SOFTWARE/OS VERSIONS

Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.13.5
KDE Frameworks Version: 5.5.0
Qt Version: 5.11.1


ADDITIONAL INFORMATION

The bug is seen under Kubuntu 18.10, using  0.6.5 PDF engine, and libpoppler 0.58.0... but the same happens using Kubuntu 14.04 (yes, from 2014)).
Comment 1 Ganton 2018-11-14 20:04:04 UTC
Created attachment 116313 [details]
The source file that can be used to create the pdf file that was attached previously
Comment 2 Magnus Aagaard Sørensen 2018-11-17 13:14:36 UTC
Steps taken to reproduce
* Open attached PDF file
* Select all text with mouse using selection tool, copy to clipboard
* Paste in text editor (Kate)
* Observed results contains additional line breaks

Alternatives investigated
* Open attached PDF file
* Select all text with "Ctrl + A", copy to clipboard
* Paste in text editor (Kate)
* Observed results contains additional line breaks

* Open attached ODT file
* Select all text with mouse using selection tool, copy to clipboard
* Paste in text editor (Kate)
* Observed results match the contents of the original file, no extra line breaks

* Open attached ODT file
* Print to PDF
* Open resulting PDF
* Select all text with mouse using selection tool, copy to clipboard
* Paste in text editor (Kate)
* Observed results match the contents of the original file, no extra line breaks

* Open PDF file in different PDF viewer (Chrome browser default viewer)
* Select all text with mouse using selection tool, copy to clipboard
* Paste in text editor (Kate)
* Observed results match the contents of the original file, no extra line breaks

It is perhaps worth noting, that when selecting only a subset of the text with the mouse tool, the phantom line breaks can be seen through the number of characters reported selected by Okular. For instance selecting "ONE*" in the last line reports 4 characters, but selecting "ONE*)" reports 6.

I'm not the developer, updating as part of the Okular Bug Day for the Bugsquad.

Application Version: 1.5.3
KDE Plasma Version: 5.14.3
KDE Frameworks Version: 5.52.0
Qt Version: 5.11.2
Comment 3 Ganton 2020-06-13 17:24:11 UTC
Note: The bug still happens using Okular 1.9.3 (with KDE Plasma 5.18.5 and Kubuntu 20.04).