Bug 595879

Summary: print preview doesn't handle multiple pages per side
Product: Red Hat Enterprise Linux 6 Reporter: Máirín Duffy <duffy>
Component: geditAssignee: Marek Kašík <mkasik>
Status: CLOSED WONTFIX QA Contact: desktop-bugs <desktop-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 6.0CC: mclasen
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-06-29 15:05:11 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
screenshot showing broken print preview - there should be two pages on the side shown, not one. the total doc size should be 2 pages not 4
none
screenshot showing pdf output - it comes out correctly, not like in the preview
none
test txt file used
none
pdf output of test txt file from gedit
none
use gtk+ print preview none

Description Máirín Duffy 2010-05-25 20:28:04 UTC
Description of problem:

If you have a long text document you want to print (say 60 pages) it can save paper to print 2 pages to a single page. I tried to do that recently using gedit. Here's the steps I followed:

- Open up text document in gedit
- Go to File > Print ...
- Go to the 'Page Setup' tab
- Under the 'Layout' section on the left, use the dropdown to select '2' pages per side (or '4' if you want to go wild)
- Hit 'Print Preview' in the lower right, left-most button

The preview only shows one page per side. I have an example document I'm working with now. It has 4 pages. When I hit preview after following the steps above, the print preview is 4 pages long, and each page only takes up half of the page and the rest of the page is blank white space.

Now, when I actually print out this document to PDF, it comes out as a 2-page document, with pages 1 & 2 on page 1, and pages 3 & 4 on page 2.

I'm going to attach screenshots of the print preview that shows only 1 page per side, and of the final PDF showing 2 pages per side in reality. I'll also attach my sample text file and the PDF output.

Version-Release number of selected component (if applicable):
gedit-2.28.4-2.el6.x86_64
printer-filters-1.1-4.1.el6.noarch
gutenprint-5.2.5-1.el6.x86_64
(If there's other components you need version numbers of let me know)

How reproducible:
Very, just follow the steps above.

Comment 1 Máirín Duffy 2010-05-25 20:30:15 UTC
Created attachment 416510 [details]
screenshot showing broken print preview - there should be two pages on the side shown, not one. the total doc size should be 2 pages not 4

Comment 2 Máirín Duffy 2010-05-25 20:31:06 UTC
Created attachment 416511 [details]
screenshot showing pdf output - it comes out correctly, not like in the preview

Comment 3 Máirín Duffy 2010-05-25 20:31:29 UTC
Created attachment 416512 [details]
test txt file used

Comment 4 Máirín Duffy 2010-05-25 20:31:55 UTC
Created attachment 416513 [details]
pdf output of test txt file from gedit

Comment 5 Máirín Duffy 2010-05-25 20:33:22 UTC
Note I was only able to reproduce this issue with gedit's print preview. If I try to print out multi-page sides from Evince, the print preview comes out correctly.

Comment 7 Matthias Clasen 2010-05-27 01:41:35 UTC
This is a limitation of gedit's builtin print preview. 
Assigning this to Marek.

Comment 8 RHEL Program Management 2010-06-07 16:02:55 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.

Comment 9 Marek Kašík 2010-06-21 15:38:21 UTC
Created attachment 425674 [details]
use gtk+ print preview

Hi,

I had a look at it. The problem is that gedit uses GtkPrintOperation, which is a high level API, but tries to do print preview itself (which is already part of GtkPrintOperation). Gedit would need access to some private members of GtkPrintOperation class to be able to draw preview correctly or it has to do the whole preview itself.
The solution can be to use GtkPrintOperation's print preview instead of the one in gedit. There is only 1 major difference I see in this case. It is that the window with print preview will be floating instead of embedded.
The positive thing I see is that it unifies print preview with the rest of Gnome.
What do you think about it Matthias (it is quite a big change in comparison with upstream) ?

Regards

Marek

Comment 10 Matthias Clasen 2010-06-29 14:53:10 UTC
I'd really like to see this at least being in an upstream bug, with some agreement that this may be the right thing forward...

Comment 11 RHEL Program Management 2010-06-29 15:05:11 UTC
Development Management has reviewed and declined this request.  You may appeal
this decision by reopening this request.