You are not logged in.

#1 2012-02-10 01:40:50

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,134

Printing solution for KDE?

I just wondered if anybody had a good work around for the print dialog problems in KDE (and presumably QT apps generally). I guess some distros patch the sources but this seems to require recompiling QT which I'm not keen to do and the patches are for an older version anyway.

There are many references to the issue in both KDE and QT bug trackers e.g. https://bugs.kde.org/show_bug.cgi?id=180051.

Basically, the issue is that the print dialog seems to have two parts. One part reflects the CUPS configuration for the printer. As far as I can tell the purpose of this part of the dialog is to sow confusion among users but perhaps that is not actually intentional. It seems, in any case, to have no effect whatsoever.

The second part is some sort of QT print setup dialog. There are multiple issues with this. First, it is insensitive to the capabilities of the printer advertised by the PPD file via CUPS. So it doesn't matter whether the printer has fine-grained quality control in CUPS, it won't here. Likewise, it doesn't matter whether the printer can print colour or not, it will offer this option.

So the first issue is that some settings just cannot be set through the dialog.

The next issue is that this dialog uses defaults which do not depend on the defaults configured via CUPS. For example, no physical printer I use has letter paper; all of these are configured in CUPS to default to A4. But the print dialog defaults to letter paper. Similarly, CUPS is set to default to duplex and greyscale but the dialog defaults to single-sided in colour. Most of the printers I use do not even offer colour. Some of them need quality settings adjusted to get good output and this can't even be done via the dialog.

This means that if I just print without reconfiguring via the dialog, I get "color, letter, single-sided" rather than "greyscale, A4, duplex, additional options".

Finally, the configuration isn't saved. It must be done not only for each session or each application but for every single job sent from a KDE application and any other application which hooks into the KDE print framework. Every single job. KDE offers a GUI alternative to the CUPS web interface but I'm not sure why since it has zero affect.

The result is obviously very irritating, time-consuming and wasteful of toner and trees.

I'm therefore wondering how other people manage this issue or whether any workarounds are available which do not involve patching and compiling QT source. Apart from the issue of having to do that and having to do it on every update, the available patch even if it worked for QT 4.8.0 doesn't actually fix most of the above problems. It would not, for example, pick up the A4 default or enable me to set different quality settings.

I'm wondering about trying to write some command line scripts but I'm not sure if this is the best solution so I'd like to know if better ones might be possible first. I'm not sure what the current best command line print command is although I figure that shouldn't be too hard to establish. But this would be very inconvenient for many applications. The only reason I'm considering it is because it wouldn't be too bad from Kile since the Konsole is right there anyway; and acroread doesn't rely on KDE for printing. Most of my printing is either kile -> okular -> print or acroread -> print. I'd still have issues with libreoffice, web browsers etc. so I'd rather find a more general solution if possible. (I know I can print to PDF and then print that but I might as well just go through the config unless I need quality settings in that case.)

Or should I just buy a pencil?!


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#2 2012-02-10 23:00:46

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,134

Re: Printing solution for KDE?

I don't suppose there's any way of getting CUPS to enforce defaults no matter what QT print tells it, is there? I assume that QT is still using CUPS to spool to the printer so CUPS must touch every job after QT, right? So is there a way to intervene there?

Last edited by cfr (2012-02-10 23:01:15)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#3 2012-02-11 02:12:06

SteveK
Member
Registered: 2010-06-11
Posts: 80

Re: Printing solution for KDE?

Did you try setting defaults via kdesu systemsettings > printer configuration?  Any changes I make like this are persistent and are reflected in the CUPS interface.

Offline

#4 2012-02-11 03:02:16

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,134

Re: Printing solution for KDE?

Changes made there persist and are reflected in CUPS, yes. Also changes made in CUPS persist and are reflected there.

But the settings have no effect on KDE applications e.g. Okular. It just doesn't use these settings at all. I don't know why they bother including this GUI!

Or are you saying that if, for example, you change the default for a printer from single-sided to duplex, when you go to print from a KDE app, the default will be set to duplex in the dialog and if you just proceed without intervening, the job will be printed double-sided? (Duplex is just an example: changes to paper size, colour vs. greyscale; speed/quality; etc. all behave in the same way.)

KDE's GUI for CUPS is rather annoying, isn't it? Once I make a change and apply it, it asks me if I want to save changes every time I change tab or printer in the config dialog thereafter. The settings do stick, though. They just have no effect on anything.

More accurately, they have no effect in applications, such as Okular, which use the default KDE printing dialog. They do affect e.g. acroread which uses its own. Not sure about gtk apps.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#5 2012-02-11 04:39:18

David Batson
Member
Registered: 2011-10-13
Posts: 640

Re: Printing solution for KDE?

I took a look in the Printer Forum section of the Mageia Forums (a KDE based distro) and found the following.  Don't know if it helps your situation or not.

https://forums.mageia.org/en/viewtopic. … =212#p1389

Offline

#6 2012-02-11 09:45:08

SteveK
Member
Registered: 2010-06-11
Posts: 80

Re: Printing solution for KDE?

cfr wrote:

Or are you saying that if, for example, you change the default for a printer from single-sided to duplex, when you go to print from a KDE app, the default will be set to duplex in the dialog and if you just proceed without intervening, the job will be printed double-sided? (Duplex is just an example: changes to paper size, colour vs. greyscale; speed/quality; etc. all behave in the same way.).

Yes, those persistent changes are actually carried through to the printout.  It just works for my HP Photosmart.

If changes you make directly in the CUPS interface aren't respected either, I suspect it may be a more general issue than a KDE/QT one, as David Batson suggests.
Have you tried printing from non-KDE/QT apps? Are changed CUPS default settings applied in that case?

Offline

#7 2012-02-11 21:30:04

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,134

Re: Printing solution for KDE?

SteveK wrote:

If changes you make directly in the CUPS interface aren't respected either, I suspect it may be a more general issue than a KDE/QT one, as David Batson suggests.
Have you tried printing from non-KDE/QT apps? Are changed CUPS default settings applied in that case?

Yes, it works as expected in acroread, for example. That picks up the CUPS defaults no problem.

Edit: I also just checked the print dialog for Firefox and that looks fine. (I didn't actually print but the default settings from CUPS are picked up: A4, duplex etc. for the printer I checked.)

The problem definitely seems to be KDE/QT specific and I would dearly love to know what I'm doing wrong and you are doing right. There are a whole bunch of other people on the KDE/QT bug pages who would probably also like to know how you've got it working!

Question, rather random: how many printers do you have set up?

Just to clarify: you are talking about KDE/QT installed from Arch's repositories, right?

Last edited by cfr (2012-02-11 21:40:54)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#8 2012-02-11 21:34:20

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,134

Re: Printing solution for KDE?

David Batson wrote:

I took a look in the Printer Forum section of the Mageia Forums (a KDE based distro) and found the following.  Don't know if it helps your situation or not.

https://forums.mageia.org/en/viewtopic. … =212#p1389

Thanks but that's a different problem. The duplex option is present in the ppd files (CUPS finds it, acroread uses it etc.) and the option is not greyed out in Okular's print dialog. I can print duplex OK from Okular. But the setting (along with all the others) does not pick up CUPS defaults and must be reset for every print job. Also, the problem occurs for a bunch of different printers I use and they all use different ppd files.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#9 2012-02-12 01:52:08

SteveK
Member
Registered: 2010-06-11
Posts: 80

Re: Printing solution for KDE?

I just have the one printer, although I have set it up in 2 or 3 different KDE distros and I'm just using normal Arch packages here.

Oh and just to clarify, today I re-checked changing paper type between A4/Letter and colours to greyscale/colour as default settings, rebooted and the print dialogue reflected those changes, along with the printed output.  I have no idea why it works for some people and not others.

What about running from a terminal? Any related errors show up?

Offline

#10 2012-02-12 02:39:43

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,134

Re: Printing solution for KDE?

SteveK wrote:

I just have the one printer, although I have set it up in 2 or 3 different KDE distros and I'm just using normal Arch packages here.

The reason I asked is because there are at least two patches available to fix the bug but they require compiling the whole of QT from source. Most distros, however, include these patches. So the fact that it works for you in another distro means nothing but the fact that it works for you in Arch is very, very interesting.

The KDE developers don't seem to expect it to work. Discussion at https://bugs.kde.org/show_bug.cgi?id=180051 reveals that they think that Arch are "douchebags" for not patching QT. (Please note that I am *not* endorsing this view as the bug thread on KDE should make clear.)

Unless, of course, they *are* patching it and something is weird about my config. How would I find that out?

Oh and just to clarify, today I re-checked changing paper type between A4/Letter and colours to greyscale/colour as default settings, rebooted and the print dialogue reflected those changes, along with the printed output.  I have no idea why it works for some people and not others.

My print dialog doesn't even reflect it 30 seconds later, let alone after a reboot! (And I reboot quite often so it isn't the lack of rebooting, either.)

What about running from a terminal? Any related errors show up?

Sorry for being dumb. How would I run it from the terminal? Or what would I run? Do you just mean start e.g. okular from terminal? I don't get anything interesting:

okular <random-file>.pdf 
okular(24864)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:
okular(24864)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:
okular(24864)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:
okular(24864)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:
okular(24864)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:
okular(24864)/kdeui (kdelibs) KXMLGUIClient::~KXMLGUIClient: 0x8b9230 deleted without having been removed from the factory first. This will leak standalone popupmenus and could lead to crashes.

I didn't actually print as I'm not connected to a printer right now, but I opened the print dialog, selected a printer and examined both "properties" and "options". The "advanced" properties always shows the CUPS defaults but they have no effect on anything. The "options", as usual, defaulted to letter/singe-sided/color etc.

But perhaps that's not what you meant by "run from a terminal"?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#11 2012-02-12 02:46:58

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,134

Re: Printing solution for KDE?

I discovered that some printers have two media size settings in the advanced properties tab. I also discovered you can crash okular if you try to change too many things. And the letter/A4 option seems to have disappeared from the standard "options" listings so now there is no way to even pick it. But maybe it will behave better with an actual printer connected...


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#12 2012-02-12 18:59:56

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,134

Re: Printing solution for KDE?

I've noticed that the KDE control module for printing also acts oddly. Should it not prompt for authentication if you try to change something requiring root privileges? I'm also not sure... is it altering personal defaults rather than system wide defaults, as the web interface for cups does?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#13 2012-02-14 18:25:30

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,134

Re: Printing solution for KDE?

I've also made sure that lpoptions are set correctly - just in case. I set my office printer to default (rather than CUPS PDF) and just ran

lp <random pdf>.pdf

from the Konsole in Kile rather than printing from Okular. In that case, everything works fine - I get default duplex etc. (I can't tell for sure about greyscale as it isn't a colour printer but although I'm not sure how to set that with lpoptions, I suspect it is picking up the CUPS defaults.)

Last edited by cfr (2012-02-14 18:25:56)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

Board footer

Powered by FluxBB