Bug 174354 - Defaults to A4 paper, even though 'US Letter' is specified in settings
Summary: Defaults to A4 paper, even though 'US Letter' is specified in settings
Status: RESOLVED UPSTREAM
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: print-dialog (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
: 184188 189546 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-11-05 17:58 UTC by Steven Wittwer
Modified: 2018-01-24 20:59 UTC (History)
13 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steven Wittwer 2008-11-05 17:58:02 UTC
Version:            (using KDE 4.1.2)
OS:                Linux
Installed from:    Ubuntu Packages

When trying to print any PDF file from Okular, it defaults to A4 paper, which my printer won't print, even though I have it set to 'US Letter' in the systems settings.  Other applications seem to print fine (IE: Open Office).  I can go into the printer properties and change it to Letter, and it prints fine for that job, but the next print will default back to A4.
Comment 1 Pino Toscano 2008-11-05 18:21:49 UTC
The print dialog is provided by Qt, so KDE has almost no control over it.
Comment 2 Steven Wittwer 2008-11-05 18:23:44 UTC
OK, but the print dialog works fine, and in other apps, it works as expected, but Okular is telling the print system to use A4 paper, ignoring what I have set as default.
Comment 3 Rex Dieter 2008-11-05 19:51:22 UTC
I've seen this too, hadn't been bothered enough to report it.  :)
Comment 4 Steven Wittwer 2008-11-05 19:57:17 UTC
(In reply to comment #3)
> I've seen this too, hadn't been bothered enough to report it.  :)
> 
Yeah, unfortunately for me, my printer is wireless, and is a ways away, so if I forget to make the change, it can be a pain to go to the printer, then cancel the job, and re print.
Comment 5 Pino Toscano 2008-11-16 14:40:48 UTC
The problem is general for any KDE 4 application (and NOT only for Okular), as the printing dialog is provided by Qt; thus, this kind of KDE setting will not affect it at all.
qt-bugs@trolltech.com is for you.
Comment 6 Steven Wittwer 2008-11-16 15:52:11 UTC
(In reply to comment #5)
> The problem is general for any KDE 4 application (and NOT only for Okular), as
> the printing dialog is provided by Qt; thus, this kind of KDE setting will not
> affect it at all.
> qt-bugs@trolltech.com is for you.
> 
Can you give me an example of another application in KDE that would exhibit the same behavior then?  I have tried Kate, OO, Konqueror, and none of them have had this problem, only Okular...
Comment 7 Albert Astals Cid 2008-11-16 22:51:19 UTC
More than probably not related to that, but probably we should add 

dummy.setPageSize( printer.pageSize() );

in PDFGenerator::print
Comment 8 Albert Astals Cid 2008-11-16 23:04:22 UTC
Does kate from kde4 rember your settings? It does not here, are you sure you are not using kate from kde3?
Comment 9 Steven Wittwer 2008-11-16 23:10:24 UTC
I don't have kde 3.5.x installed (although I'm sure there are componenets involved...)  if I do an 'about KDE' from kate, it shows 4.1.3.
Comment 10 ietc 2008-12-30 02:07:34 UTC
I can confirm that Okular (version 0.7.3) erroneously defaults to A4 paper size and shows a blank pane for Advanced printer options -- whereas KWrite (version 4.1.3 "release 4.9") shows the correct paper size (e.g., Letter) and all the Advanced printer options.  Other programs that behave correctly are Konqueror (version 4.1.3 "release 4.9") and Gwenview (version 2.1.3).

I can also confirm that Okular exhibits CORRECT behavior when printing PostScript and JPG files.  Okular appears to only behave incorrectly when attempting to print PDF files.

This bug may be the same as Bug #176999 and Bug #177360

openSUSE 11.1
Comment 11 Steven Wittwer 2008-12-30 03:10:42 UTC
let the finger pointing begin...again...
Comment 12 John Layt 2008-12-30 11:14:26 UTC
This appears to be a duplicate of #177360, but needs confirmation.  Can you confirm that selecting Print / Properties / Advanced gives you a blank advanced settings page?  If so it is the same bug.
Comment 13 John Layt 2009-01-15 01:02:36 UTC
I'm closing based on assumption it is a duplicate and the original has now been resolved.  Upgrade to KDE 4.1.4 or 4.2 RC1, or Qt 4.5.0 when it comes out in March.

*** This bug has been marked as a duplicate of bug 177360 ***
Comment 14 James Richard Tyrer 2009-02-13 00:04:30 UTC
This bug has not been fixed.  See bug 184188
Comment 15 Pino Toscano 2009-04-14 19:11:21 UTC
This is not solved yet in Qt, so sorry John, but have to reopen it (or mark it as UPSTREAM? tell me.)
Comment 16 Pino Toscano 2009-04-14 19:11:41 UTC
*** Bug 184188 has been marked as a duplicate of this bug. ***
Comment 17 Pino Toscano 2009-04-14 19:13:59 UTC
*** Bug 189546 has been marked as a duplicate of this bug. ***
Comment 18 Paul Cullum 2009-11-24 02:14:11 UTC
I believe that bug 185296 is a duplicate of this.  I can't believe how long this bug has been around.  Doesn't anyone else from North America use KDE?
Comment 19 Paul Cullum 2009-12-01 13:56:25 UTC
The QT print dialog will print Letter for me if I actually select letter within the dialog.  If the CUPS settings are for Letter then the print dialog will show Letter however it will still print A4.  If I select something else in the dialog (A4) and then change it back to letter it will then print Letter. 

To me it appears as though QT is reading the CUPS settings and will display them but that that it isn't in the correct state to use the settings unless they've explicitly been configured through actions in the dialog.  Almost as though it doesn't get fully initialized with system settings.

This likely is a QT bug but perhaps there could be a KDE workaround by having KDE somehow programatically toggle the settings in the dialog each time it opens as if a user had done it.  Perhaps this could also be done somehow when printing without the dialog which always prints A4 since I can't change it.
Comment 20 Erec 2010-02-01 15:58:03 UTC
I understand this might be an upstream bug with QT, but if you can put a little pressure on them to fix it, it would be appreciated. http://bugreports.qt.nokia.com/browse/QTBUG-6302 and to reproduce (with sample application): http://bugreports.qt.nokia.com/browse/QTBUG-6471
Comment 21 Ian Pilcher 2013-07-10 15:08:44 UTC
(In reply to comment #20)
> I understand this might be an upstream bug with QT, but if you can put a
> little pressure on them to fix it, it would be appreciated.
> http://bugreports.qt.nokia.com/browse/QTBUG-6302 and to reproduce (with
> sample application): http://bugreports.qt.nokia.com/browse/QTBUG-6471

Anyone have updated links?
Comment 22 Ian Pilcher 2013-07-10 16:19:42 UTC
(In reply to comment #21)
> Anyone have updated links?

Found it.

  https://bugreports.qt-project.org/browse/QTBUG-6471

Looking at the patch posted in that bug report, I notice that it will only take effect if neither QT_NO_CUPS nor QT_NO_LIBRARY is defined in the Qt build.  In the Fedora 19 Qt SRPM (qt-4.8.4-19.fc19.src.rpm), QT_NO_LIBRARY appears to be defined in qmake/qmake.pri.
Comment 23 Christoph Feck 2013-07-18 23:51:02 UTC
Ian, please report this issue directly to Qt developers via https://bugreports.qt-project.org/
Comment 24 Michael Weghorn 2018-01-16 15:04:45 UTC
I think this should have been fixed in the meanwhile and could not reproduce the issue.
Can others confirm this or does anybody still have the problem with current versions of Qt 5?
Comment 25 Garry Williams 2018-01-24 19:50:55 UTC
It's not fixed.

Kmail 5.7.1 exhibits this behavior.

Both Okular (1.2.1) and Kmail always are set to print A4 no matter what I did in the past.  Duplex mode is also forgotten from one print to the next.

This seems very broken since I set these options in the system and *all* non-KDE applications respect my settings automatically.
Comment 26 Michael Weghorn 2018-01-24 20:59:49 UTC
(In reply to Garry Williams from comment #25)
> It's not fixed.
> 
> Kmail 5.7.1 exhibits this behavior.
> 
> Both Okular (1.2.1) and Kmail always are set to print A4 no matter what I
> did in the past.  Duplex mode is also forgotten from one print to the next.
> 
> This seems very broken since I set these options in the system and *all*
> non-KDE applications respect my settings automatically.

Thanks for the reply and sorry if my previous comment caused confusion.
The actual cause why the wrong paper size is selected by default (and not the default paper size configured by the user) is a problem of the underlying Qt library used by KDE applications, not of KDE or the applications (like KMail or Okular) themselves.

The problem has been fixed for the current development version of Qt, s. this change: https://codereview.qt-project.org/#/c/213677/

Users will profit from this once their distribution ships the (upcoming) Qt version 5.11 or their Linux distribution backports the corresponding change to the Qt version they provide.

As far as the preselected value for duplex is concerned, there is a separate bug report for this, bug 333844. While this is currently filed against Okular, it is also an issue in Qt and I am very confident that this is going to be fixed in Qt very soon as well.

Since the issue is not in KDE itself (and has already been fixed upstream), I am closing this bug report.

Please let me know in case there are any further questions.