Red Hat Bugzilla – Bug 580898
Applet could detect incorrect page size for new queues
Last modified: 2013-06-20 06:26:36 EDT
Description of problem:
The applet is well-placed to spot a common problem: that the system locale differs from the console user's own locale, and that this causes a different default paper size to be selected for a queue that has just been automatically created for a USB printer.
It is a fairly simple check. In the NewPrinterNotification service, the applet just needs to find out what the LC_PAPER locale setting is. If it is C, POSIX, en, or begins "en.", "en_US", "en_CA", or "fr_CA", there is nothing further to do. Otherwise, the default page size *ought* to be A4.
Then it should look at the DefaultPageSize attribute in the PPD. If it is 'Letter', or anything like it, then the system locale has not been set and is still the default ("en_US"). At this point, the applet should offer the user the opportunity to set the default page size to A4, and should suggest that the user corrects their system locale using system-config-language.
Even better: the NewPrinterNotification interface could be modified to allow the udev-add-printer process to collect the user's locale from the applet, allowing the queue to be correctly set up in the first place even when the system locale is wrong.
Some en locales are A4 too, for example en_ZA.
(my system locale is en_ZA, and a new printer was just added with paper=letter, which is why I searched for this bug. Fedora 17)
Berend: actually I think you are probably seeing bug #818265 there.
I'm sure I'm seeing #818265 too. However, #818265 doesn't fix all use cases for "printer has wrong paper size," as explained further below.
Neither this bug, nor #818265 allows for a way to correct the mistake. Unless you know cups, once a printer has the wrong paper size in Fedora, you're in trouble.
The only way for me to change the paper size was cups' config -- either vi /etc/cups/.ppd or http://localhost:631/ -- there was no "userfriendly" way in Fedora 17.
I don't know if this is a bug in Fedora 17 or Gnome 3.4; but Gnome -> System Settings doesn't allow you to configure a printer beyond "create printer"
I couldn't choose a different paper size in Evolution -> Print, etc. I had to go to cupsd to fix it to be able to print, or live with the dreaded "pc load letter" on the printer.
So there is a fourth bug: gnome print dialog doesn't allow user to select paper size. This is the client library, not system settings. The dialog Gnome apps use to print, or the way that evolution uses it.
And there's a fifth bug: firefox print dialog chooses wrong paper size by default for locale. It's set to "us letter", but it lets me pick any paper size I want. It's not currently set in prefs.js (no user preference.) Firefox sets print.postscript.paper_size to letter instead of A4. https://bugzilla.mozilla.org/show_bug.cgi?id=194268 is open since 2003, https://bugzilla.mozilla.org/show_bug.cgi?id=147419 since 2002. I guess I shouldn't moan: I haven't submitted a patch myself.
For selecting default paper size (create printer):
When creating a printer, there are three options for choosing paper size. All three can be different.
1. cupsd's locale (bug #818265) -- but what if it's a network printer, and the remote cupsd server has a different locale?
2. the current user's locale (this bug) -- but what if it's a network printer?
3. the printer's paper tray (where available, and where there is only one tray)
1, 2 and 3 can all three be different. Examples are specialized paper printers, and cups servers in a different location than the client. This has interesting implications for cloud-hosted services.
For selecting available paper sizes (print queue):
Query the printer. Most desktop printers list everything, printers with multiple trays usually list the paper per tray. What to do with empty trays?
For selecting final paper size (app print):
1. Default to the client machine's locale
2. confirm list of printer possible paper sizes.
3. allow override if count(1) != 1, count(2) != 1, and 1 != 2.
This bug is a very, very cool idea to fix some of these problems.
(In reply to comment #4)
> The only way for me to change the paper size was cups' config -- either vi
> /etc/cups/.ppd or http://localhost:631/ -- there was no "userfriendly" way
> in Fedora 17.
The system-config-printer (available since Fedora) allows you to change page sizes and other options, and in Fedora 18 the GNOME System Settings application will also provide a way to do this.
> So there is a fourth bug: gnome print dialog doesn't allow user to select
> paper size. This is the client library, not system settings. The dialog
> Gnome apps use to print, or the way that evolution uses it.
That's odd. It works fine for me. Perhaps it's a quirk of the particular PPD you are using, or some strange interaction between that and the print dialog?
> And there's a fifth bug: firefox print dialog chooses wrong paper size by
> default for locale.
> For selecting default paper size (create printer):
> When creating a printer, there are three options for choosing paper size.
> All three can be different.
> 1. cupsd's locale (bug #818265) -- but what if it's a network printer, and
> the remote cupsd server has a different locale?
So in this example, you're talking about creating a queue for a network printer that is in another timezone than the CUPS server. This is definitely the domain of a "system administrator"...
> 2. the current user's locale (this bug) -- but what if it's a network
Again, it's very likely that the printer you are printing to is walkable from the location you are printing from, and I would expect that to cover the vast majority of instances of use.
> 1, 2 and 3 can all three be different. Examples are specialized paper
> printers, and cups servers in a different location than the client. This
> has interesting implications for cloud-hosted services.
Remember, we're talking about *creating* CUPS queues here, not just using them. In particular, this bug is about how to react to a USB printer being connected, so the system/user locale is the most useful place to default page size from. We don't yet try fetching the option defaults from the printer itself, although that's mostly useful for network printers that understand PostScript natively.
(For *using* a queue, there is only one default that makes sense: the default media size for the queue, set when the queue was created. There is no point overriding that with any locale settings, as the printer is loaded with whatever paper it's loaded with, and moving the client to another locale won't change that.)
Fedora gets installed with the correct system locale now so this shouldn't be needed.