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 355350 - Page Setup, Range and Copy information ignored
Page Setup, Range and Copy information ignored
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Printing
2.10.x
Other Linux
: Normal major
: ---
Assigned To: gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2006-09-10 22:32 UTC by Arthur Taylor
Modified: 2006-12-11 04:08 UTC
See Also:
GNOME target: ---
GNOME version: 2.15/2.16


Attachments
Support multi-value options (3.51 KB, patch)
2006-12-08 14:10 UTC, Jürg Billeter
none Details | Review

Description Arthur Taylor 2006-09-10 22:32:04 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
Comment 1 Matthias Clasen 2006-09-16 04:27:52 UTC
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.
Comment 2 Arthur Taylor 2006-09-17 04:32:36 UTC
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 */
Comment 3 Matthias Clasen 2006-09-17 05:36:50 UTC
Be more specific, please. What app ? 
I already pointed out a gtk-print using application that works correctly... 
Comment 4 Arthur Taylor 2006-09-17 07:11:40 UTC
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.
Comment 5 Sebastien Bacher 2006-10-24 09:47:10 UTC
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?
Comment 6 Jürg Billeter 2006-12-08 14:10:24 UTC
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?
Comment 7 Arthur Taylor 2006-12-09 23:27:20 UTC
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.
Comment 8 Matthias Clasen 2006-12-10 05:50:36 UTC
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 ?

Comment 9 Jürg Billeter 2006-12-10 09:04:49 UTC
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.
Comment 10 Matthias Clasen 2006-12-10 19:19:31 UTC
Ok, thanks for explaining. 
I'll look at the patch in some more detail tomorrow.
Comment 11 Matthias Clasen 2006-12-11 04:08:59 UTC
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)