Bug 204621 - "GtkPrint" asks for "Letter" size paper when "A4" size was chosen
"GtkPrint" asks for "Letter" size paper when "A4" size was chosen
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: gtk2 (Show other bugs)
9
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Marek Kašík
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-08-30 10:12 EDT by Joachim Frieben
Modified: 2008-06-16 23:27 EDT (History)
0 users

See Also:
Fixed In Version: 2.12.10-4.fc9
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-06-13 17:55:46 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
a patch (3.34 KB, patch)
2006-09-28 12:37 EDT, Matthias Clasen
no flags Details | Diff
new patch (13.70 KB, patch)
2006-09-29 15:15 EDT, Matthias Clasen
no flags Details | Diff
Fedoradized version of patch from comment #8 (12.26 KB, text/plain)
2006-09-30 06:43 EDT, Joachim Frieben
no flags Details
Default print settings in "evince" using the "GtkPrint" dialog (18.79 KB, image/png)
2007-06-14 09:48 EDT, Joachim Frieben
no flags Details

  None (edit)
Description Joachim Frieben 2006-08-30 10:12:29 EDT
Description of problem:
For current "evince-0.5.5-2.fc6", the attached "HP LaserJet 4100"
does not print "PDF" documents. Instead, a red warning light is
flashing, and the printer asks to "load plain letter". However,
default paper size is "A4".

Version-Release number of selected component (if applicable):
gtk2-2.10.2-4.fc6

How reproducible:
Always

Steps to Reproduce:
1. Open document with "evince" document viewer.
2. Print document.
  
Actual results:
No document is printed. The printer asks to load plain letter paper.

Expected results:
The document is printed without prompting the user.

Additional info:
Printing from "gedit" which uses the standard "GNOME" printing dialog
works flawlessly. This rules out a "CUPS" problem such as the one
reported in bug 191601. The "evince" document viewer has adopted a
different printing dialog, apparently the "GtKPrint" one as the
application changelog indicates. As matter of fact, in this dialog
neither the current paper size is displayed nor can it be modified.
Comment 1 Joachim Frieben 2006-09-01 07:25:16 EDT
I have rebuilt "evince-0.5.5-2.fc6" with option "--with-print=gnome".
Now, the standard "GNOME" printing dialog is used, and documents
get printed instantaneously without prompting the user for letter
size paper as in my initial report. It seems that the issue definitely
stems from the stock "GTK" printing interface.
There is no option in the spec file which sets the printer interface
type explicitly to one of "no/gtk/gnome", and thus "evince" seems to
somehow pick up the "gtk" one.
A quick fix would be to add "--with-print=gnome" to the build options.
Comment 2 Joachim Frieben 2006-09-05 17:23:58 EDT
After a fresh install from the "rawhide" tree including new upstream
"evince-0.6.0-1.fc6", printing works again correctly.
Comment 3 Joachim Frieben 2006-09-06 14:43:12 EDT
(In reply to comment #2)
Sorry for the "bad news" but although my first observation was for
real although based on a modest single printout, it has turned out
in the meantime that "evince-0.6.0-1.fc6" is actually still afflicted
by the issue described above. :(
Btw, it appears that "epiphany-2.16.0-1.fc6" also uses the "GtkPrint"
backend and as such gives me the same headache. Unlike the "evince"
case, here at least, one as an additional "Print Setup..." dialog
which allows to set the actually employed paper size.
However, regardless of all installed printers having paper size set
to "A4", the initial paper size displayed in the setup window is
"letter" which seems to indicate that "GtkPrint" does not actually
look up the paper size settings correctly.
Comment 4 Matthias Clasen 2006-09-28 12:37:14 EDT
Created attachment 137325 [details]
a patch
Comment 5 Alexander Larsson 2006-09-28 12:44:37 EDT
I dunno about that patch. I'm slighly worried that a GtkPageSetup object will be
returned from the page setup dialog, and the app scales its output to the size
the page setup object lists, but then the printer picks a different print size
at the end.

Can we not store this state on a later object in the print operation. Like if
you don't set a page setup object on the print operation or something like that.
Comment 6 Joachim Frieben 2006-09-28 13:56:39 EDT
I haven't tried out the patch yet, but what about telling the "configure"
script to use the "GNOME" printing backend instead? As far as I can see
from the spec file, the "GTK" printing backend hadn't been chosen
deliberately but rather picked up by "configure" since no other had been
chosen explicitly. In the past it seems to have defaulted to the "GNOME"
one.
Comment 7 Matthias Clasen 2006-09-29 12:32:32 EDT
I have discussed this with alex a bit more, and these were the outcomes:

- we should have gtk_printer_get_default_paper_size() or similar to 
  obtain the ppd default

- the cups function which my patch touched needs to at least check that
  the default it sets is actually an allowed value
 
- the page setup dialog should select the default paper size for a printer
  when selecting a different printer from the list, only the generic entry
  should use the locale-derived default

- if no explicit page setup has been set on a print dialog, selecting
  a different printer should change the paper size to the default paper
  size of the printer
Comment 8 Matthias Clasen 2006-09-29 15:15:52 EDT
Created attachment 137426 [details]
new patch
Comment 9 Matthias Clasen 2006-09-29 15:17:08 EDT
Here is a patch which tries to implement most of these things.
Comment 10 Joachim Frieben 2006-09-30 06:43:28 EDT
Created attachment 137471 [details]
Fedoradized version of patch from comment #8 

Hm, unless I have committed some stupid mistake myself, it seems that
the patch from comment #8 does not really do the job as expected.
After rebuilding "gtk2-2.10.4-2.fc6" with the attached patch, "evince"
and "epiphany" still request letter size paper. I had removed all dot
directories before to get rid of previous settings. The "epiphany"
printing settings show paper size "letter" by default which can be set
to "A4" by the user, and indeed after that, it prints correctly.
I also have to add that "evince" behaves differently depending on the
"PDF" file actually in use. It seems that the paper size extracted
from the "PDF" file overrules the default paper size set for the
printer. I have both "PDF" files which either print out directly or
trigger the request for letter size paper although the printer device
is the same in both cases. Shouldn't the paper size associated with
the printer have priority in this case?
Comment 11 Joachim Frieben 2007-06-14 09:48:27 EDT
Created attachment 156995 [details]
Default print settings in "evince" using the "GtkPrint" dialog

This is what one sees when opening a "PDF" file. The paper
setting is "US Letter", even upon repeated launches of "evince".
The paper size preference thus is not stored somewhere.
Unless one sets the size to "A4" manually and everytime, the
printer whose default paper size is "A4" will refuse to print
and prompt the user to load "US Letter" size paper.
Comment 12 Joachim Frieben 2007-06-14 09:51:33 EDT
(In reply to comment #11)
This applies to current "F7" featuring:

 - "cups-1.2.10-10.fc7"
 - "evince-0.8.0-5.fc7"
 - "gtk2-2.10.12-2.fc7"
Comment 13 Joachim Frieben 2008-02-16 10:53:23 EST
Setting "LC_PAPER" to "de_DE.UTF-8" in my shell configuration file actually
allows to obtain the desired behaviour of "GNOME" applications defaulting
to the correct default paper size "A4".
Otherwise, still no improvement for the current "rawhide" selection:

 - cups-1.3.5-6.fc9
 - evince-2.21.91-1.fc9
 - gtk2-2.12.8-1.fc9

"GtkPrint" needs to check the paper size of the chosen printer and adopt
it in the "Print Settings..." panel. Ideally, it would further modify it
according to the print device chosen by means of the "Format for:"
drop-menu button. One would also expect that the value of the latter is
somehow memorized after being initially set to the system default printer
instead of "Any Printer" and modified by the user.
Btw, why is the "Print Settings..." subwindow titled "Page Setup"? This
seems to be a bug, too ..
Comment 14 Bug Zapper 2008-05-13 22:18:43 EDT
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 15 Matthias Clasen 2008-05-20 22:17:51 EDT
Patch has been committed upstream
Comment 16 Marek Kašík 2008-06-13 10:58:07 EDT
Hi,
I committed fix to F9 CVS. Its release is gtk2-2.12.10-4.

  Thank you for reporting this bug

    Marek
Comment 17 Joachim Frieben 2008-06-13 18:17:47 EDT
It would be much better to have "Page Setup" display the default
printer. Currently, it shows "Any Printer". Otherwise, e.g. when
altering the orientation, one has to choose the default printer
first which is more awkward. Should this be filed as an RFE?
Comment 18 Marek Kašík 2008-06-16 06:11:28 EDT
Hi Joachim,
fill this as feature request in upstream bugzilla please.

  Thank you

    Marek
Comment 19 Fedora Update System 2008-06-16 23:27:13 EDT
gtk2-2.12.10-5.fc9 has been submitted as an update for Fedora 9

Note You need to log in before you can comment on or make changes to this bug.