Bug 348598 - Print Preview doesn't show entire file contents
Summary: Print Preview doesn't show entire file contents
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: 5.0.0
Platform: Kubuntu Linux
: NOR minor
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
: 409470 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-06-02 16:20 UTC by Greg Lepore
Modified: 2019-07-04 09:28 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.60


Attachments
Image showing actual file and truncated Print Preview (355.71 KB, image/jpeg)
2015-06-02 16:21 UTC, Greg Lepore
Details
Original file (33.00 KB, text/x-python)
2015-06-02 16:22 UTC, Greg Lepore
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Greg Lepore 2015-06-02 16:20:53 UTC
Print Preview only displays part of a large file, but the entire file prints. See attachment for screenshot showing Print Preview and the actual file. Apparently it only occurs when a very long line appears at (or near) the end of a Preview page. Adding or subtracting a blank line allows Print Preview to display the entire file.

Reproducible: Always

Steps to Reproduce:
1. Open file with long lines
2. Select Print Preview
3. 

Actual Results:  
All pages after a long line near a page break are not displayed

Expected Results:  
All pages should be displayed
Comment 1 Greg Lepore 2015-06-02 16:21:44 UTC
Created attachment 92967 [details]
Image showing actual file and truncated Print Preview
Comment 2 Greg Lepore 2015-06-02 16:22:13 UTC
Created attachment 92968 [details]
Original file
Comment 3 Greg Lepore 2015-09-03 16:46:04 UTC
Just upgraded to Kubuntu Wily Beta 1, with plasma 5.4.0 and QT 5.4.2 and the problem is still appearing.
Comment 4 Buovjaga 2016-06-25 15:48:13 UTC
Greg: Kate hangs for me in print preview, what about for you with the latest version?

Arch Linux 64-bit
Kate 16.04.2
KDE Frameworks 5.23.0
Qt 5.7
xcb wm
Comment 5 Greg Lepore 2016-06-25 15:52:21 UTC
I'm still on 15.12.3, with Qt 5.5.1. This bug still occurs but I do not get a hang.
Comment 6 Buovjaga 2016-06-25 16:05:48 UTC
Ok, I guess you could test with the bleeding edge, like KDE Neon, in a virtual machine to find out, if it is even safe for you to upgrade. https://neon.kde.org/
Comment 7 Christoph Cullmann 2016-09-07 20:55:28 UTC
Works okay for me with frameworks 2.25 + Kate 16.08
Comment 8 Mark van Rossum 2017-05-24 11:07:32 UTC
Same bug for me on Fedora 25 with
- kate-16.12.3-1.fc25.x86_64
- qt5-qtbase-5.7.1-16.fc25.x86_64
Comment 9 Greg Lepore 2017-07-20 13:51:33 UTC
Resetting status to Unconfirmed as the bug is still occurring on KDE Neon:

Kate 17.04.3
KDE Frameworks 5.36.0
Qt 5.9.1 (built against 5.9.1)
The xcb windowing system
Comment 10 Nate Graham 2017-12-06 22:39:14 UTC
We have reports that the print preview is entirely blank for some people: https://bugs.kde.org/show_bug.cgi?id=376270

Is anyone still experiencing the original issue with truncation as outlined here, or is everyone now seeing totally blank print previews?
Comment 11 Greg Lepore 2017-12-06 22:43:18 UTC
Original reporter here. I'm still seeing the exact same behavior as described in this report.

kate 17.08.3
KDE Frameworks 5.40.0
Qt 5.9.3 (built against 5.9.1)
The xcb windowing system

Thanks.
Comment 12 Buovjaga 2017-12-07 07:48:57 UTC
(In reply to Greg Lepore from comment #2)
> Created attachment 92968 [details]
> Original file

When I tested last year, I got a hang, but now I can reproduce similarly like Greg says. The page cut off happens on page 4 for me and blank pages follow, with a lonely line on one page.

Arch Linux 64-bit
Kate 17.08.3
KDE Frameworks 5.40.0
Qt 5.9.3
Comment 13 Dominik Haumann 2019-06-23 20:56:02 UTC
Proposed patch: https://phabricator.kde.org/D21563
Comment 14 Dominik Haumann 2019-06-29 20:26:34 UTC
Git commit 6bbbe6aa51c0a293a58dbca6223e37a73ce32122 by Dominik Haumann, on behalf of Robert Hoffmann.
Committed on 29/06/2019 at 20:26.
Pushed by dhaumann into branch 'master'.

Fix empty pages in print preview and lines printed twice

Summary:
There were errors if a page's last line is too long and needs to be
wrapped into two or more lines:
- The first line of the wrapped lines was printed correctly at the end
  of the page, but on the next page this first line was printed again.
- In print preview the first wrapped line was shown correctly at the
  end of the page, but the next and following pages were empty.

Reasons:
- remainder variable was always 0
- clipping was not reset

Test Plan:
In Kate, open a text file that has long lines. Check lines at page ends
which are wrapped to the next page. Check printing and print preview.

Reviewers: #kate, #ktexteditor, dhaumann

Reviewed By: #kate, #ktexteditor, dhaumann

Subscribers: cullmann, dhaumann, ngraham, kwrite-devel, kde-frameworks-devel

Tags: #kate, #frameworks

Differential Revision: https://phabricator.kde.org/D21563

M  +4    -1    src/printing/printpainter.cpp

https://commits.kde.org/ktexteditor/6bbbe6aa51c0a293a58dbca6223e37a73ce32122
Comment 15 Dominik Haumann 2019-07-04 09:28:23 UTC
*** Bug 409470 has been marked as a duplicate of this bug. ***