After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 549859 - "file" printer doesn't support n-up
"file" printer doesn't support n-up
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Printing
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: gtk-bugs
: 390331 566218 571412 (view as bug list)
Depends on:
Blocks: 557112
 
 
Reported: 2008-08-29 19:57 UTC by Christian Persch
Modified: 2009-07-30 18:19 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Patch adding n-up printing capability for file backend. (22.53 KB, patch)
2009-04-08 13:44 UTC, Marek Kašík
needs-work Details | Review
Patch adding n-up printing capability for file backend. (32.73 KB, patch)
2009-05-04 16:37 UTC, Marek Kašík
committed Details | Review

Description Christian Persch 2008-08-29 19:57:50 UTC
Steps to repro:
0) $ tests/print-editor
1) File->Print
2) Select "Print to File" printer
3) Change to Page Setup tab

Actual results:
The "Pages per side" and "Page ordering" options are insensitive.

Expected results:
Can select n-up and n-up page layout options.
Comment 1 Christian Persch 2008-08-29 20:14:57 UTC
Hmm actually I guess it's the gtkprintoperation that needs to implement support for this, for when the printer doesn't support it.
Comment 2 Matthias Clasen 2009-01-02 20:38:48 UTC
*** Bug 566218 has been marked as a duplicate of this bug. ***
Comment 3 Marek Kašík 2009-02-12 09:32:53 UTC
*** Bug 571412 has been marked as a duplicate of this bug. ***
Comment 4 Marek Kašík 2009-04-08 13:44:19 UTC
Created attachment 132339 [details] [review]
Patch adding n-up printing capability for file backend.

Hi,
this patch add n-up printing capability for the file backend. It modifies GtkPrintOperation mainly.
Should be tested with patch from the bug #420335 applied.

  Marek
Comment 5 Matthias Clasen 2009-04-09 05:24:33 UTC
Hmm, the patch worked great for the first few tries. Now I am getting a segfault as soon as I open the print dialog:

GLib-GObject-CRITICAL **: g_object_ref: assertion `G_IS_OBJECT (object)' failed


This comes from update_number_up_layout:

      if (priv->number_up_layout_n_option == NULL)
        {
          priv->number_up_layout_n_option = gtk_printer_option_set_lookup (set, "gtk-n-up-layout");
          g_object_ref (priv->number_up_layout_n_option);

Comment 6 Marek Kašík 2009-05-04 16:37:43 UTC
Created attachment 133931 [details] [review]
Patch adding n-up printing capability for file backend.

Hi,
I fixed the problem with segfaults. I also changed choices for 2 pages per landscape sheet to "Top to bottom", "Bottom to top".
This patch also enable multiple pages per sheet for lpr backend.

  Marek
Comment 7 Matthias Clasen 2009-05-07 05:16:35 UTC
Works pretty good in my testing with evince now.

A number of things I noticed, maybe not directly the fault of this patch:

- evince doesn't offer page reordering when printing to file, the gtk test print-editor does.

- when printing to an actual printer, the evince print preview has a window title of evince_print.(null).93STTU. Obviously, something was NULL that evince didn't expect to be - but the window title should not show a temp filename in the first case...

- page ordering is messed up. the number-on-a-page visualization in the print dialog gets it right, but the preview is wrong. e.g 6-up, lrtb comes out as

2 4 6
1 3 5   

(the actual preview is turned 90° clockwise)

Actually, page ordering doesn't seem to make any difference whatsoever, doing 6-up, tblr comes out just the same

- even/odd is messed up too (I believe there are other reports about this). When doing 2-up, even only, I get a preview with

[ 2 4 ] [ 6 8 ] ...

which is even _pages_, not even _sheets_. The correct output would be:

[ 3 4 ] [ 7 8 ] ... 

ie apply the even/odd filtering as the last step, after grouping pages into sheets.
Comment 8 Matthias Clasen 2009-05-07 05:26:46 UTC
*** Bug 390331 has been marked as a duplicate of this bug. ***
Comment 9 Matthias Clasen 2009-05-07 05:29:31 UTC
Seems that bug 340136 and bug 420335 are related to the issues I mentioned.
Comment 10 Carlos Garcia Campos 2009-05-07 07:59:15 UTC
Matthias, are you trying with evince from git master? or have you patched it? 
Comment 11 Matthias Clasen 2009-05-07 13:33:03 UTC
No, this was with evince 2.26.1. 
Comment 12 Carlos Garcia Campos 2009-05-07 15:36:46 UTC
Then, evince is not using this patch. Evince doesn't use gtk-print-operation yet. As soon as this patch is in, I'll push the changes needed in evince. See bug #557112.
Comment 13 Matthias Clasen 2009-05-07 16:19:00 UTC
Ah, thanks for letting me know. I'll repeat my testing with another app then.
Comment 14 Matthias Clasen 2009-05-07 16:28:34 UTC
With gedit, page reordering seems to work fine, and even/odd sheets also seem to do what I expect (for print-to-file, haven't tested cups).

Cool. I'll have another look over the patch, but I think this is pretty much ready to go then.
Comment 15 Matthias Clasen 2009-05-07 22:10:45 UTC
Please commit.
Comment 16 Marek Kašík 2009-05-13 16:34:42 UTC
commited:

Add ability to print in number-up mode for file backend and lpr backendmaster

GtkPrintOperation is now able to render multiple pages per sheet by its own. The most important changes are in these functions: * increment_page_sequence * prepare_data * common_render_page * print_pages_idle Patch also changes set of choices for 2 pages per sheet mode when landscape orientation is used to "Top to bottom" and "Bottom to top".

  Marek
Comment 17 Bartek Kostrzewa 2009-07-30 18:19:04 UTC
The bug seems to have reappeared in a weird way.

bug #590084 in evince has an illustration of what's happened