Archive for the ‘kdeprint’ Category

libkdeprint

21st October 2007

Having been working on the move away from libkdeprint and to relying almost entirely on Qt’s printing framework, it’s become clear to people the power of Michael Goffioul’s creation. Unfortunately, the only people who understand the code base, as far as I can see, are Michael himself (who has moved on to other projects) and the maintainer, Cristian Tibirna, who doesn’t have enough time available to port the library (a none-trivial task, given the size and complexity of the library and the fact that it is supposed to work as a drop-in replacement for QPrinter, which has had significant API changes).

There has been much wailing and gnashing of teeth over its removal. Just yesterday I wanted to print a booklet from Scribus, and so went looking on the internet for how to do it. A page on Scribus’ wiki told how to do it using the kprinter utility. It was a really simple task, as well, although the way I’d done it meant made it a little more complicated (I had made the pages the final size – A5 – rather than twice the original size, which requires an extra parameter to the psnup utility).

Perhaps people with the time (ie: not Cristian) and expertise (ie: not me) will cause it to make a triumphant return. Perhaps advancements in Qt’s own printing system will make it unnecessary. We shall see. Certainly, some of it needs to be salvaged for the printing kcm and for a kprinter utility. I suspect Qt will never have a “printFiles()” method that will take postscript or pdf files and print them, if only because it’s hard to implement on Windows. In fact, really the only way to do it that I can see is to take the same path as Scribus and use Ghostscript.

As KDE’s resident printing guru (Kurt Pfeifle) has commented before, printing is one of those things that is not sexy (and so doesn’t get worked on) but is necessary and really noticed by the user if it is below par. And, indeed, if it is exceptional, as KDE’s has been up to now.

KPrinter Blues

7th September 2007

I’ve been lurking around KDE for a while now, doing odd bits and pieces here and there on KDE 4. But now I’m working on something substantial (together with John Layt): making kdeprint work again.

Last week, it didn’t work. Despite all the amazing work of Michael Goffioul all those years ago in creating it, it’s looking a little tired. It hasn’t really had any serious love for many years, and the transition to Qt4 did for it.

It now works, just about. The problem, it turned out, was that the port from K3Process to KProcess hadn’t been done properly in the kded module. That’s fixed, but the codebase is reasonably large and other things are not working right.

On top of that, there’s the maintainability aspect to consider. The current code, for example, wraps QPrinter rather than inheriting from it (for good reason: it was written at the time of Qt2, when QPrinter was very inflexible) which means every QPrinter method has to be wrapped.

But, Qt4 to the rescue! The QPrinter option system has been abstracted into QPrintEngine, the painting is all done with a wrapped QPaintEngine and now QPrintDialog acts on QPrinter, rather than the other way around. We can hopefully leverage this to make the kdeprint codebase smaller and simpler.

However, there are less than four weeks to do this in. kdelibs (and kdesupport, and kdebase/runtime) go into release mode on 3rd October. Yikes.


Follow

Get every new post delivered to your Inbox.