OCT
19
2007

How To Easily Print Posters With KDEPrint [UPDATED]

What a coincidence today happened. In the morning I used KDEPrint's 'poster' frontend to create a "poor man's poster" in A1 size from 4 A3 printouts.

In the afternoon, a lady mailed me, asking why her KDE print dialog on Solaris didn't show the poster dialog, while her husband's openSUSE KDE did show it.

I took the time, mailed her back what I knew about the question, and included a few screenshots.

Two hours later I thought for myself: "WTF -- you took more than half an hour to write back to this lady and explain everything to her... Why not put another 30 minutes effort into it and convert the mail into a little tutorial to be published in my blog?".

I slightly changed my earlier mail in a few sentences, re-arranged it a bit, and posted a screenshot with a long comment to kdedevelopers.org.

Hardly I was ready with this when I saw a posting by Hin-Tak on the 'printing summit' mailing list over at linux-foundation.com, asking about ... poster again (without remembering the name of the utilitiy). Happily I mailed the link to said image with comments back to him.

And now it's "Heck! I may as well make a real blog post from it, add a few more screenshots and declare it a tutorial...."

So here we go.


You [image:3042 align="left" width=408 height=444 hspace=6 vspace=4 border=0 class="showonplanet"] may already have come across the "Poster" tab in KDE's printing dialog. The one the screenshot to the left shows. It should be there for each printer you select from the drop-down list, even the virtual ones, that "Print to File" or "Send to Fax" or "Mail PDF File".
However, the poster tab of kprinter will *NOT* show up if you don't have the "poster" utility installed and in your $PATH. So if you want it, simply install the 'poster' package.

(UPDATE: Seems after Michael Goffioul's patches from 2002 there were more new features added to poster (which I wasn't aware of). There's a bug report 132916 which was pointed out to me in a comment below by jlp. Given that the bug reporter says "version 20060221 doesn't work, while version 20050907 does", it is probably saver to download and use the latter. BTW, openSUSE ships the version 20020826 which works as well. This bug may explain why Gentoo and Debian have reverted to a 1999 version of poster, which does not work with KDEPrint.)

Obtain "poster" from here: ftp.kde.org/pub/kde/printing/.

Important: you need to use the version from the link above, should your distro's version not function properly! It contains some patches to make it work with KDEPrint (poster's commandline abilities don't suffer from these patches!). The patches (written by our deerly missed Michael Goffioul, who currently does have too little time for active KDEPrint development) have also been accepted by the upstream poster developer, years ago.

Unfortunately, some recent distro releases (Debian?, *buntu?) for some reason seem to ship an older version which makes the kprinter poster tab display an error message.

As soon as you install the patched version (compiling it is easy), kprinter will start work with it.

If you figure your distro is using a b0rken version (or no poster package at all), you should contact its respective packager and/or submit a bug report or feature request. Ask them to use the patched version of poster to make it work with KDEPrint.

Poster is meant to scale up a printout beyond available media sizes of your printer. You print [image:3045 align="left" size="thumbnail" hspace=6 vspace=4 border=0 class="showonplanet"] small tiles [image:3046 align="left" size="thumbnail" hspace=6 vspace=4 border=0 class="showonplanet"] of the final image [image:3047 align="left" size="thumbnail" hspace=6 vspace=4 border=0 class="showonplanet"] on your available paper (you do not even need to print all of them, as the line "tiles to be printed" shows). These pages you can glue together to form a "poor man's poster".

The actual printouts will slightly overlap, in order to allow some minor image shifting by the actual print devices, and by the person who uses scissors or cutters to trim the paper sheet towards the actual page image.

  • Above screenshot shows what you can tweak with the settings (click thumbnails full size).
  • Determine the final poster size by selecting from the drop down listbox.
  • Determine the size of the printouts as "Page Size" on the "General" tab.
  • The number of tiles shown dynamically adapts to these size selections.
  • To select which tiles you want at all use the mouse and hold the shift key.
  • Printout will occur in the order you clicked the tiles (or typed their number into the line edit).
  • Alternatively, just type a comma-separted list of tile numbers into the line edit field.
  • Change the "Cut Margin" as needed.

What benefit is it to make it selectable which tiles print, not not do all at once?

Well, you may want to try with two tiles first, and see if they fit and match what you expect. If they do, continue with more tiles, different ones this time. If they don't, change you settings and try again.
Tip 1: do not waste too much paper with experiments whose results you will not like. Instead you may first want to "Print to File (PDF)" by selecting such a printer in the first place.

Or enable the checkbox "Preview" on the main kprinter dialog, and cancel the printout if the preview doesn't look like you expect; then try again with different settings.

How it works "under the hood": poster is utilized as a "prefilter" by KDEPrint. When KDEPrint receives a PostScript for printing (as is the case when you print from any KDE3 application), it sends this file to poster first, using appropriate commandline options (which you do not need to know if you use the GUI shown in the screenshot -- they are a bit awkward), receives the pre-filtered file from poster and sends it on to the real print subsystem (or to the preview application you may be using).

Of course, poster (the utility) isn't perfect, and if it fails, KDEPrint can't do much about it....

What you can do when it doesn't seem to work at all...

The utility and the kprinter tab do also work if you start kprinter as a standalone application (i.e. not from the 'Print...' menu entry of an application) and load a PostScript file into it.

However, [image:3048 align="left" size="thumbnail" hspace=6 vspace=4 border=0 class="showonplanet"] if you start [image:3050 align="left" size="thumbnail" hspace=6 vspace=4 border=0 class="showonplanet"] kprinter standalone, [image:3049 align="left" size="thumbnail" hspace=6 vspace=4 border=0 class="showonplanet"] but load a non-PostScript file (text, image, PDF), and use "poster" on it, you may see an error message, or it may simply not work as expected. If you are lucky, you'll see a dialog pop up that asks if KDE should convert the original file for you to create the correct format.

Why is this?

The poster utility can only work with PostScript files and does require PostScript as input format. (To be more precise: it expects a PostScript file that follows the DSC recommendations, the Document Structuring Conventions for PostScript files).

Is there no hope then?

Yes, there is.

Stacking different pre-filters...

Just plug one more pre-filter into the pre-filtering chain of KDEPrint! One that creates the PostScript and feeds it to 'poster'. ;-)

How to do that?

Click on the right-most tab, labelled "Filters". Click on the top icon showing a funnel symbol. Select a pre-filter from the top-down list that takes your loaded input format, and converts it into PostScript:

  • "Generic Image to PS Filter",
  • "PDF to PostScript Converter", or
  • "Enscript Text Filter"

Make sure the stacking order of the two pre-filters (the "Poster" one may be active already)
is as needed. (If it's wrong, you'll see a unequivocal complaint in the user interface -- you can sort the order with the help of the "Up" and "Down" arrows.)

Tip 2: The "Preview" checkbox is not available, if you run kprinter from the commandline. If you are not confident about the results that will go on paper, and if you don't want to waste precious resources, you may want to "Print to File" first instead of the real printer. Then you can verify if the result comes at least close to what you expect by using KPDF to view it (KPDF also works with PostScript files, should you have printed to PS).

[image:3044 align="left" size="thumbnail" hspace=6 vspace=4 border=0 class="showonplanet"] Tip 3: While the "Preview" checkbox is not there, another one is, when you run kprinter from the commandline: it is on the bottom left corner of the dialog, labled "Keep this dialog open after printing", and does what it says. So as long as you are experimenting with the different print settings, you do not need to restart kprinter every time you want to change an option....

Voila! Poster printing with KDE.
From any KDE application.
With preview of results.
To any print device.
Even to the "PDF printer" that ships with KDE.
And also for any printable file format (PDF, image, PostScript, text),...
...when loaded into a kprinter started from the commandline (remember to enable an additional prefilter; one that consumes your original file, produces PostScript and pipes its output into the Poster pre-filter...)

How do you like that?

(And all this works in KDE since the days of KDE 2.2, released more than 6 years ago. But unfortunately, it was never really documented, remains a rather unknown little gem within KDEPrint, and in general is pretty under-appreciated.)

Comments

yeah, KDEprint is one of the most advanced printing systems I've ever seen. It has saved me on several occasions at work, when I had to do something weird, and only by using my linux laptop, printing to pdf and then using the work pc (with windows, of course) to print those could I get what I had to have.

It's a shame we won't have all these capabilities in KDE 4.0, I hope they manage to revive KDE print for 4.1... Or even sooner, having a KDEprint release a few months after 4.0 would rock!


By superstoned at Fri, 10/19/2007 - 10:39

Kurt, do you know if there is going to be a post in DotKDE about printing in KDE 4.0 and beyond? As an outsider, things are looking pretty bad.

Of course, probably it is nobody's fault: "who codes, decides". But I will definitely stick with KDE 3.5 (even without security updates) until printing in KDE 4 is a suitable replacement for current kprinter. I was hoping for new features (in my case, a more intuitive printing dialog and interactive and more realistic preview), so the current situation is sad. Given this, I hope the next LTS Kubuntu is *not* based on KDE 4. I do hope that they backport KDE 4 applications like they have done with dolphin as long as they work fine with the current kprinter.


By manuellópezibáñez at Fri, 10/19/2007 - 13:59

manuellópezibáñez,

no, I do not know for sure if there is going to be a post in DotKDE about printing in KDE 4.0 and beyond, or if the hackers working on it will indeed publish one or two blog postings. (However, they have promised to write in their blogs once they are ready with some stuff, but they must also be very busy right now...)

If you seek more detailed information, read the last 6-8 weeks worth of archived discussions of the kde-core-devel mailing list, and/or search for "print" in the weekly Commit Digests.

For all I know, at least it will be possible for all KDE3 applications to still run and work on top of KDE4 (or inside a KDE4 environment). Like, vice-versa, all or most KDE4 apps should run (at least with appropriate "standalone" functionality) inside a KDE3 invironment.

That means, you should be able to run kprinter from KDE3 as a standalone application in KDE4 with all the functionality you are used to. Even if the way direct printing from inside a KDE application will not be to your taste in 4.0 (we are promised to get everything back by 4.1, though), there will still be the workaround of "Save as..." or "Export to..." PDF files (and, maybe, PostScript)... Which files you can in turn load into kprinter3 to do what you want with them.


By Kurt Pf. at Fri, 10/19/2007 - 15:02

Thanks for this printing tip. I didn't know about this before and even without this tip I like KDE printing system a lot since it is very powerful. Hope KDE 4 series will get all the features back soon.

I have tried to find out about support for this in Gentoo and they have an old version of poster and refuse to use the new version and the reason for this is KDE bug 132916:

Is this bug still valid? Has it been fixed?

--
Live long and prosper!
JLP's Blog - http://jlp.holodeck1.com/blog/


By Jure Repinc at Fri, 10/19/2007 - 17:27

Hi, jlp,

thanks for your hint about bug #132916. This was news to me! I never came across this bug -- but no wonder: it was filed against product "Unknown", component "General". :-)

I can assure you that I'll also close this bug report after once more looking at it in some more detail (I may have missed a point in my first quick flick).

(Update: I indeed missed an important point: the fact that after 2002, there were some *more* modifications and feature additions to poster, which also seemed to have introduced some new bugs. And it seems that the default download location currently still points to the buggy tarball. I updated above main story accordingly.)

I've never seens such an error with poster (I've seen others, yes. But not this one). I can't believe this bug report is used as a justification to go back to a 1999 version of poster. This looks even more dumb, since the bug reporter says that versions 20050907 and 20020826 work for him, and the bug he saw was with version 20060221 only. Tss, tss, tss...

In any case, that bug report as it currently stands is useless, because it doesn't provide any details:

* It doesn't enumerate the steps how to re-produce it.
* It doesn't provide an example PostScript file that triggers this bug.

I do not rule out that some PostScript files (probably ones that don't conform to the DSC conventions) can trigger that error message. I'll ask the reporter to supply more details.

However, it is a shame that a complete distro is using this bug to justify not enabling KDEPrint's poster utility.

Hopefully, removing the bug from KDE's bugzilla will help re-enable a more modern poster for Gentoo and Debian.

Did you try to compile it on your own on Gentoo? Does it work for you? If so, one more reason to talk to your Gentoo maintainers again.


By Kurt Pf. at Fri, 10/19/2007 - 20:43

Well Gentoo has version 20050907 in portage, so it is not 1999* version. They just don't use the 2006* one and they cited that KDE bug in the changelog as the reason. So it is not as bad as it may have sounded when I wrote the first comment. I just pointed to that bug since 2006* version was linked as the download originally and I just wanted to warn that there may be some problem with the latest version.

BTW I've also checked which version is in use in Mandriva 2008 and they have 20060221 installed, by deafult if I'm not wrong.

I'll try to compile the 2006 myself on my Gentoo later and see how it goes.

--
Live long and prosper!
JLP's Blog - http://jlp.holodeck1.com/blog/


By Jure Repinc at Fri, 10/19/2007 - 23:35