How to write a (pre-)filter

Anna Föglein foeglein at mi.uni-erlangen.de
Thu Mar 15 18:20:58 CET 2007


Hi,

I'm trying to get the KDE printing system to use a hand-made script as a 
virtual printer, but I can't figure out how.

The complete task is: I want to print documents from my laptop on my maths 
department's printers.

The situation: I use a laptop with Kubuntu (Edgy), hooking it up to the math 
department's network, which consists of Sun workstations. I have a login for 
those Suns. Due to historical reasons, it is not possible to send a print job 
to the department's print server from anywhere else than these Suns.

Work-around at the moment: I have written a script, which automates the 
process of taking a .ps file (or converting .pdf and .dvi to .ps), copying it 
to a temporary file on a Sun via scp, logging in on the Sun, issueing the 
print command, and finally deleting the temporary file. This script needs 
a .ps or .pdf or .dvi file as an argument, i.e. it can't just read the data 
to be printed from stdin. This script is called "miprint".

What I would like: Calling the miprint script from the command line is quite 
tedious, so it would be nice to have a KDE printer that does the same: Print 
to a temp file, and then get the tempfile printed on the Suns. 

I've tried to solve this problem by defining a "special printer" with a filter 
filter, but how does this exactly work? Is a filter the right tool to print a 
document to a temporary .ps file, and then give this temp file to a script? 
If yes, how does the syntax work, e.g. what exactly is "%in" (input file? ps 
made from input file? data stream?), how is it connected with "%filterinput" 
and what is this "pipe" thing one can also define in this context? I've 
looked at the XML files of the pre-defined filters but they didn't help too 
much.

If a filter is the wrong approach anyway, what would be the right one?

Anyway, when KDEPrint prints something for e.g. user "anna", with what user ID 
is this done? (This could be important for things like reading ssh keys etc.)

Thanks in advance for any help!

Anna Foeglein

--------------------------------------------

Anna Foeglein

Address: Mathematisches Institut 
	 Universitaet Erlangen-Nuernberg
	 Bismarckstr. 1 1/2
	 91054 Erlangen

Phone:	 +49-(0)9131-8522974


More information about the kde-print mailing list