Printer installation paper type does not follow locale

Bug #150691 reported by Paul Flint
2
Affects Status Importance Assigned to Milestone
libpaper (Baltix)
Invalid
Undecided
Unassigned
libpaper (Debian)
New
Unknown
libpaper (Ubuntu)
Fix Released
Wishlist
Unassigned
system-config-printer (Ubuntu)
Fix Released
High
Tim Waugh

Bug Description

Binary package hint: gnome-panel

When you install a printer in Ubuntu. The paper type remains "A4". In the US standard paper size is "Letter" the result of this mismatch is that a postscript printer sees a conflict in paper type and will not print.

This is a first citing so I would like confirmation.

Kindest Regards,

Flint
<email address hidden>

Revision history for this message
Paul Flint (flint) wrote : Re: [Bug 150691] Re: Printer installation paper type does not follow locale

Dear Pedro,

Did you confirm or fix this?

Regards,

Flint

On Mon, 8 Oct 2007, Pedro Villavicencio wrote:

> Date: Mon, 08 Oct 2007 20:10:44 -0000
> From: Pedro Villavicencio <email address hidden>
> Reply-To: Bug 150691 <email address hidden>
> To: <email address hidden>
> Subject: [Bug 150691] Re: Printer installation paper type does not follow
> locale
>
> ** Changed in: system-config-printer (Ubuntu)
> Sourcepackagename: gnome-panel => system-config-printer
>
> --
> Printer installation paper type does not follow locale
> https://bugs.launchpad.net/bugs/150691
> You received this bug notification because you are a direct subscriber
> of the bug.
>

/************************************

Paul Flint
17 Averill Street
Barre, VT
05641

http://www.flint.com/home
skype: flintinfotech
Work: (202) 537-0480
  Fax: (703) 852-7089

Free advice .~.
is worth /V\
exactly what /( )\
you pay for it. ^^-^^

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Do you have an /etc/papersize file? What is in the file? With which country setting did you set up your computer?

Changed in system-config-printer:
status: New → Incomplete
Revision history for this message
Paul Flint (flint) wrote :

Dear Till,

Thank you for kindly pointing out to me the existence of /etc/papersize!

In answer to your questions...

On Mon, 8 Oct 2007, Till Kamppeter wrote:

> Do you have an /etc/papersize file?
>

Yes indeed I do!

> What is in the file?
>
-rw-r--r-- 1 root root 3 2006-05-30 20:54 papersize

In the file are three bytes

a4

2 + /n...

> With which country setting did you set up your computer?
>

The Free Republic of Vermont, currently under the tyrannical yolk of the
Bush Administration of the United States...

:^)

I am not at all happy with that bastard cowboy, but I digress...

Note I specifically indicated US during installation.

Finally I know what a monster Locale is. I standby to help in any way.

Regards,

Flint

/************************************

Paul Flint
17 Averill Street
Barre, VT
05641

http://www.flint.com/home
skype: flintinfotech
Work: (202) 537-0480
  Fax: (703) 852-7089

Free advice .~.
is worth /V\
exactly what /( )\
you pay for it. ^^-^^

Revision history for this message
Paul Flint (flint) wrote :

Greetings Exterminators,

I have unilaterally changed the content of papersize to "letter". This
will no doubt have cascading effects which eventually shut down the
Internet and then life as we know it on this planet.

I want to observe if this manual intervention fixes this problem...

Regards,

Flint

/************************************

Paul Flint
17 Averill Street
Barre, VT
05641

http://www.flint.com/home
skype: flintinfotech
Work: (202) 537-0480
  Fax: (703) 852-7089

Free advice .~.
is worth /V\
exactly what /( )\
you pay for it. ^^-^^

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

For me system-config-printer does not respect /etc/papersize. On my system it is set to "a4" and system-config-printer sets Letter as default paper size.

Tim, can you add /etc/papersize (libpaper) support to system-config-printer?

Changed in system-config-printer:
assignee: nobody → twaugh
importance: Undecided → High
milestone: none → gutsy-updates
status: Incomplete → Triaged
Revision history for this message
Paul Flint (flint) wrote :

Dear Till,

I noticed exactly the same effect. Also note that /etc/papersize is not
always created... I would like to know more about the specification for
the /etc/papersize file.

Regards,

Flint

On Tue, 16 Oct 2007, Till Kamppeter wrote:

> Date: Tue, 16 Oct 2007 13:58:39 -0000
> From: Till Kamppeter <email address hidden>
> Reply-To: Bug 150691 <email address hidden>
> To: <email address hidden>
> Subject: [Bug 150691] Re: Printer installation paper type does not follow
> locale
>
> For me system-config-printer does not respect /etc/papersize. On my
> system it is set to "a4" and system-config-printer sets Letter as
> default paper size.
>
> Tim, can you add /etc/papersize (libpaper) support to system-config-
> printer?
>
>
> ** Changed in: system-config-printer (Ubuntu)
> Importance: Undecided => High
> Assignee: (unassigned) => Tim Waugh (twaugh)
> Status: Incomplete => Triaged
> Target: None => gutsy-updates
>
> --
> Printer installation paper type does not follow locale
> https://bugs.launchpad.net/bugs/150691
> You received this bug notification because you are a direct subscriber
> of the bug.
>

/************************************

Paul Flint
Barre Open Systems Institute
17 Averill Street
Barre, VT
05641

http://www.bosivt.org
http://www.flint.com/home
skype: flintinfotech
Work: (202) 537-0480
  Fax: (703) 852-7089

Free advice .~.
is worth /V\
exactly what /( )\
you pay for it. ^^-^^

Revision history for this message
Tim Waugh (twaugh) wrote :

Till: is this for a queue where you are providing a PPD file, or where you a selecting a PPD from the list? If it's from the list cupsd decides on the paper size.

When a PPD file is provided, system-config-printer tries to adjust the paper size in the same way cupsd would have if it had been in the list.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

It is from the list. What I did is the following (my /etc/papersize contains simply "a4"):

In system-config-printer I click the "New printer" button, then in the list of detected printers I choose "Print into PDF file". In the next two steps I leave the pre-selections "Generic" and "PDF file generator" and in the last step the suggested name "PDF_file_generator". After that I have a new print queue named "PDF_file_generator" with "Letter" as default paper size.

Then I go into the web interface http://localhost:631/, choose "Administration", then "Add printer", as name I take "x", then I choose as device "PDF file generator" and stay with the default "Generic PDF file generator" as model/driver. The paper size default of my new print queue "x" is A4 now.

During installation of Ubuntu I had once to choose the language (I chose english) and once the time zone (I chose Lisbon/Portugal). The output of "locale", once for me and once for root you can see below.

----------
till@till-laptop:~/printing/foomatic/foomatic-filters-devel$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
till@till-laptop:~/printing/foomatic/foomatic-filters-devel$ sudo locale
[sudo] password for till:
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
till@till-laptop:~/printing/foomatic/foomatic-filters-devel$
----------

Revision history for this message
Paul Flint (flint) wrote :

Dear Tim,

Good to hear from you!

Are there any pages on launchpad on this topic.

See ya in Boston.

Regards,

Flint

On Tue, 16 Oct 2007, Tim Waugh wrote:

> Date: Tue, 16 Oct 2007 14:44:11 -0000
> From: Tim Waugh <email address hidden>
> Reply-To: Bug 150691 <email address hidden>
> To: <email address hidden>
> Subject: [Bug 150691] Re: Printer installation paper type does not follow
> locale
>
> Till: is this for a queue where you are providing a PPD file, or where
> you a selecting a PPD from the list? If it's from the list cupsd
> decides on the paper size.
>
> When a PPD file is provided, system-config-printer tries to adjust the
> paper size in the same way cupsd would have if it had been in the list.
>
> --
> Printer installation paper type does not follow locale
> https://bugs.launchpad.net/bugs/150691
> You received this bug notification because you are a direct subscriber
> of the bug.
>

/************************************

Paul Flint
Barre Open Systems Institute
17 Averill Street
Barre, VT
05641

http://www.bosivt.org
http://www.flint.com/home
skype: flintinfotech
Work: (202) 537-0480
  Fax: (703) 852-7089

Free advice .~.
is worth /V\
exactly what /( )\
you pay for it. ^^-^^

Revision history for this message
Tim Waugh (twaugh) wrote :

Till: well, have you tried setting your system locale to something where A4 is actually used?

The primary method for setting paper sizes is always going to be the locale. glibc provides support for LC_PAPER; CUPS keys off the locale string -- there really is no need for an extra (conflicting) mechanism to find out which paper size to use.

I understand that CUPS has support for libpaper (IMHO needlessly). Adding support for this to system-config-printer would mean creating Python bindings for it as there do not appear to be any currently. It is not something I am prepared to spend any time on. I just don't see the benefit.

Revision history for this message
Patrice Vetsel (vetsel-patrice) wrote :

It's strange and i confirm this bug.

For informations i had Bug #128258 (closed now)

In this bug when /etc/papersize (a4 for me) is not present, adding new printer resulting in using letter paper size.
Now it's not the case, and all printers, with /etc/papersize set to a4 or letter or file deleted resulting in using a4 size.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

I have tried the following two command lines

LC_PAPER="en_IE.utf8" system-config-printer
LC_ALL="en_IE.utf8" system-config-printer

and created a new printer each time. In both cases A4 should be selected by default, but I got A4 only for the latter case.

I think having two methods to determine the default paper size is confusing. We should better do away with libpaper in Hardy completely and make sure that all programs needing a default paper size using the locale settings (preferably LC_PAPER and fall back to LC_ALL if LC_PAPER is undefined). In addition, there should be a GUI tool added where the locale settings can be easily changed, so that if a user goes to another country temporarily with his laptop that he can quickly adapt settings to that country.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

We could also let libpaper take its default from the locale, so that if /etc/papersize does not exist or contains "auto" or "locale" that then the paper size is taken from the locale.

Changed in libpaper:
status: New → Invalid
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
Tim Waugh (twaugh) wrote :

Till: system-config-printer is constrained to use the same mechanism that cupsd does, and that is to key off LC_MESSAGES when it exists (see cups/language.c, scheduler/conf.c). If cupsd started taking notice of LC_PAPER, so much the better -- and I would change system-config-printer to match.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Then cupsd is also not correct, for something there must be LC_PAPER.

CUPS is supporting libpaper natively, at least if libpaper-dev is installed when CUPS is compiled. Perhaps one should explicitly cancel the libpaper support via a ./configure option (How is it done by Red Hat?).

In general, we must reach a state where every program looking for a default paper size should do it exactly the same way.

Revision history for this message
Paul Flint (flint) wrote :

Dear Till,

I am very impressed at your scholarship in this matter, and agree with
your assessment of the paper-type bug right up to the following statement:

On Thu, 18 Oct 2007, Till Kamppeter wrote:

> In addition, there should be a GUI tool added where the locale settings
> can be easily changed, so that if a user goes to another country
> temporarily with his laptop that he can quickly adapt settings to that
> country.
>

Last year Kevin Cole, Nick Wheeler and I (et al.) wrote a command line
tool, which thanks to Kevin Cole ended up in Python, called GIN (Gnome
Instant Nationalization). The good news is that this code could be a
prototype for what you are talking about. The bad news is that Locale is
a very complicated matter in Gnome.

Please refer to: https://wiki.ubuntu.com/gin

Basically, be very careful!

Regards,

Flint

/************************************

Paul Flint
Barre Open Systems Institute
17 Averill Street
Barre, VT
05641

http://www.bosivt.org
http://www.flint.com/home
skype: flintinfotech
Work: (202) 537-0480
  Fax: (703) 852-7089

Free advice .~.
is worth /V\
exactly what /( )\
you pay for it. ^^-^^

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Paul, did you remove the program from the public again? Your link is dead.

In general your program will not affect settings for default paper sizes, because:

1. Your program only switches interface languages, not locales (info abou the country where the user is located)
2. Your program only changes settings for individual users, but print queues are owned by the system, so what we need for default paper size consistency is a tool to quickly switch the system-wide defaults of the locale settings.

So everyone pointing us to a program to easily switch the system's locale settings (not only the language) is welcome. Also command line tools are welcome (one can easily add a button to an existing GUI which calls this tool or make some mini GUI to only switch the system's default locale, like we have my-default-printer to set the default printer).

Revision history for this message
Tim Waugh (twaugh) wrote :

> Then cupsd is also not correct, for something there must be LC_PAPER.

Yes, I agree. (In practice this usually makes no difference, but it would be good to get it fixed.)

>CUPS is supporting libpaper natively, at least if libpaper-dev is installed
> when CUPS is compiled. Perhaps one should explicitly cancel the libpaper
> support via a ./configure option (How is it done by Red Hat?).

Just by not building with it enabled.

  --enable-libpaper turn on libpaper support, default=no

Revision history for this message
Kevin Cole (kjcole) wrote :

The gin program that Paul Flint referred to in a previous comment now
resides as a bazaar repository in http://dc.ubuntu-us.org/bazaar/gin/

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Kevin, thank you. I have corrected the Wiki page now.

Revision history for this message
Pascal De Vuyst (pascal-devuyst) wrote :

> When you install a printer in Ubuntu. The paper type remains "A4".

This problem is solved in Ubuntu 7.10 (Gutsy), the Ubuntu Desktop CD installer ubiquity now sets /etc/papersize to match the selected locale instead of defaulting to A4 (see bug #104160).

Paul Flint, which version of Ubuntu are you using?

Revision history for this message
Paul Flint (flint) wrote :

Pascal,

Thanks for the tip about Gutsy...

On Tue, 23 Oct 2007, Pascal De Vuyst wrote:

> Date: Tue, 23 Oct 2007 17:35:41 -0000
> From: Pascal De Vuyst <email address hidden>
> Reply-To: Bug 150691 <email address hidden>
> To: <email address hidden>
> Subject: [Bug 150691] Re: Printer installation paper type does not follow
> locale
>
>> When you install a printer in Ubuntu. The paper type remains "A4".
>
> This problem is solved in Ubuntu 7.10 (Gutsy), the Ubuntu Desktop CD
> installer ubiquity now sets /etc/papersize to match the selected locale
> instead of defaulting to A4 (see bug #104160).
>
> Paul Flint, which version of Ubuntu are you using?
>

Bug was found in various LTS versions 6.06, 6.10...

> --
> Printer installation paper type does not follow locale
> https://bugs.launchpad.net/bugs/150691
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Sounds like this one is closed for the moment.

Regards,

Flint

/************************************

Paul Flint
Barre Open Systems Institute
17 Averill Street
Barre, VT
05641

http://www.bosivt.org
http://www.flint.com/home
skype: flintinfotech
Work: (202) 537-0480
  Fax: (703) 852-7089

Free advice .~.
is worth /V\
exactly what /( )\
you pay for it. ^^-^^

Revision history for this message
Pascal De Vuyst (pascal-devuyst) wrote :

Till and Tim,

The reason why there are 2 methods to retrieve the default papersize is historical.
The LC_PAPER environment variable was not part of the original POSIX standard.
To tackle the default papersize problem the Debian operation system gave birth to libpaper (/etc/papersize), most programs in Debian/Ubuntu use libpaper to retrieve the paper size, CUPS is also compiled with libpaper support.
Later a DRAFT specification of a newer POSIX standard included the LC_PAPER environment variable, glibc was based on this DRAFT specification. But the FINAL version of this POSIX standard didn't include the LC_PAPER environment variable, this is also the current POSIX standard version.

So both methods can be used by application developers depending if they target POSIX compliance or only Linux compliance. In Debian/Ubuntu we could agree on any of these methods and adapt all programs to use this method. As some heavy discussion will be needed here I don't think this bug report is the best place to discuss. Furthermore this effort would be limited to Debian/Ubuntu only as long as there is no new POSIX standard that clearly describes how the default papersize should be retrieved.

With bug #104160 being closed in Gutsy, I think most users won't even notice there are 2 methods to retrieve the papersize since /etc/papersize will match the locale selected at install time.

Can we close the original bug reported by Paul Flint?

Revision history for this message
Paul Flint (flint) wrote :

Dear Pascal,

On Tue, 23 Oct 2007, Pascal De Vuyst wrote:

> Can we close the original bug reported by Paul Flint?
>

Pascal, thanks for your excellent analysis of this issue. This bug is
hereby squashed!!! The record will help anyone else who is running LTS in
the future.

The best part of this is your knowledge of the history of the two
variables and /etc/papersize. That is just cool and needs to be recorded
in our Ubuntu annals...

Thank you again Pascal De Vuyst!

Kindest Regards,

Paul Flint

/************************************

Paul Flint
Barre Open Systems Institute
17 Averill Street
Barre, VT
05641

http://www.bosivt.org
http://www.flint.com/home
skype: flintinfotech
Work: (202) 537-0480
  Fax: (703) 852-7089

Free advice .~.
is worth /V\
exactly what /( )\
you pay for it. ^^-^^

Revision history for this message
Henrik Nilsen Omma (henrik) wrote :

"Can we close the original bug reported by Paul Flint?" Closed

Changed in system-config-printer:
status: Triaged → Fix Released
Changed in libpaper:
status: Confirmed → Fix Released
Revision history for this message
Paul Flint (flint) wrote :

Greetings,

Indeed, this but is closed.

Regards,

Flint

On Mon, 17 Dec 2007, Henrik Nilsen Omma wrote:

> Date: Mon, 17 Dec 2007 12:40:44 -0000
> From: Henrik Nilsen Omma <email address hidden>
> Reply-To: Bug 150691 <email address hidden>
> To: <email address hidden>
> Subject: [Bug 150691] Re: Printer installation paper type does not follow
> locale
>
> "Can we close the original bug reported by Paul Flint?" Closed
>
> ** Changed in: system-config-printer (Ubuntu)
> Status: Triaged => Fix Released
>
> ** Changed in: libpaper (Ubuntu)
> Status: Confirmed => Fix Released
>
> --
> Printer installation paper type does not follow locale
> https://bugs.launchpad.net/bugs/150691
> You received this bug notification because you are a direct subscriber
> of the bug.
>

/************************************
Based upon email reliability concerns,
please send an acknowledgement in response to this note.

Paul Flint
Barre Open Systems Institute
17 Averill Street
Barre, VT
05641

http://www.bosivt.org
http://www.flint.com/home
skype: flintinfotech
Work: (202) 537-0480
  Fax: (703) 852-7089

Free advice .~.
is worth /V\
exactly what /( )\
you pay for it. ^^-^^

Changed in libpaper (Debian):
status: Unknown → New
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.