GNOME Bugzilla – Bug 355350
Page Setup, Range and Copy information ignored
Last modified: 2006-12-11 04:08:59 UTC
Any settings for the number of copies, page range, or page setup layout option (pages per sheet, odd/even only and scale options) are ignored. GTK will always print 1 copy of the entire document, one page per sheet, 100% scale, both odd and even sheets. I'm using the cups backend, not sure if it happens on other backends. Probably related to bugs 347569 and 348393
You need to describe in more detail what you are trying to do, and how. These things work fine in the printing example in gtk-demo.
Try printing from a gtk-print using app. Select "Print Odd Sheets." Expected results should be that only odd sheets are printed, actual results are that all pages are printed. This holds true for scaling and the number of pages per sheet options as well. This might have something to do with the TODO in gtkprintoperation.c around line 423, but I'm not sure: /* TODO: print out sheets not pages and follow ranges */
Be more specific, please. What app ? I already pointed out a gtk-print using application that works correctly...
I was using both evince 0.6.0 and gtk-demo for testing, both displayed the same behaviour. Gtk+ was version 2.10.3, cairo 1.2.4, cups version 1.2.3, ESP Ghostscript 8.15.2, all custom compiled.
from https://launchpad.net/distros/ubuntu/+source/evince/+bug/67164: "... > does the example of gtk-demo (gtk2.0-examples package) works fine for you? ... No, it has the same issue... "Range" on the first page of the printing dialog works but "2 pages per sheet" didn't worked either. That's what I've tested for now." Is there an easy way to determine if the issue comes from cups itself or from GTK? Is there any debug mode to give a printing log with GTK?
Created attachment 77961 [details] [review] Support multi-value options The cups backend currently treats multi-value options like job-sheets=none,none as a single value. This causes cups to ignore some other options when using a local printer, e.g. n-up printing from evince or gtk-demo doesn't work in many cases due to this bug. With the attached patch n-up and odd/even printing seems to work fine in evince and gtk-demo where it previously didn't. Does this patch solve the problem for Arthur and Sebastien, too? Ok to commit on gtk-2-10 and HEAD?
Patch in comment 6 solves the problems that I opened this bug for. Odd/Even sheet selection, sheet scaling and multi-paged sheet prining works for me in the apps I tested with (gtk-demo, evince) with this patch applied.
I can see that the patch might help for job-sheets=none,none but I don't see how it could make odd/even, scaling or n-up work. Anyway, the patch does not look like the worlds most robust string-list parser to me. E.g. it happily accepts unclosed strings as in 'foo','bar It doesn't seem to complain about 'foo''bar' either (and treats it as a single string), Why are \-escapes only recognized outside of quoted strings ?
It seems that all non-ppd-specific options get ignored by cups when it finds the invalid job-sheets option value. That's the reason why it makes the other options work, too. I've got another confirmation that the patch works for n-up in IRC. I've taken the semantics from the source code of the cups library (encode.c) as I couldn't find the specification for it. If you know a differing syntax specification, I'll correct the patch accordingly.
Ok, thanks for explaining. I'll look at the patch in some more detail tomorrow.
2006-12-10 Matthias Clasen <mclasen@redhat.com> * modules/printbackends/cups/gtkcupsutils.c (gtk_cups_request_encode_option): Properly pass multi-value options to cups. (#355350, Jürg Billeter)