kprinter filter filterarg problem (defaults for pnsup)

kde-print@mail.kde.org kde-print@mail.kde.org
Fri, 14 Feb 2003 11:00:32 +0100


Hi,

I need (or want) better multiple pages per sheet options. The default does not 
draw boxes around the pages and messes prints slides (A4 landscape) in the 
wrong order. I am using kprinter 0.0.1 with KDE 3.1 SuSE 8.1 rpm from 
kde.org.

Playing with psnup I found the option "-l" to correct the ordering of the 
pages and "-d1" for the boxes around the individial pages.

(Note: as I regularly use over 5 printers, I do not like to create new 
instances for each printer with new settings, but directly change the filter, 
as this seems easier for me to manage.)

Locating and changing psnup.xml was not to hard. However, I learned the 
hardway, that settings corresponding to the "default" argument to the 
"filterarg" tag are no removed from the argumentslist for the command to be 
invoked. Example: I added "1" as the default to the parameter "box" and "4" 
to the parameter "nup", because I almost always print 4 pages on and I 
(lamost) always want boxes. Hower these default values are not propagated to 
psnup. I assume the meaning of "default" is the default behaviour of the 
filter program, and not the default settings of configuration of how the 
filter program should be invoked. I would prefer the latter. 

For "-d1" hardcoded my default on the command line and later overwrite it with 
%filterargs values. The same would probably work for "nup". However "-l" is a 
boolean option and not easy to overwrite (well I do not fully understand the 
psnup terminology of landscape and seascape etc.). Please find my hack below.

(Note: I also played with the graphical dilter editor, which is quite nice, 
however I was not able to understand how to properly add boolean options, so 
vi was my friend ;-)


Whishes:
--  Some simple document on the filter definition xml format greatly 
appreciated (pointers welcome). 
--  Differentiate between default values the filter program assumes or work 
with and default values for the filter definition.
--  Provide nicer multiple pages print options: boxes with shadows around the 
indivdial pages, page numbers on the new pages. This is probably off topic 
and should be addressed within psnup and/or maybe cups.


Thanks for hints and pointers and the _really_ _great_ work (and improvements) 
on kde-print.

- tom


HACK psnup.xml adds default boxes of the size "1" and offers "landscape" 
printing (of 4 landscape slides on 1 page). Note: I do not know, whether 
"landscape" is the right term.

<!DOCTYPE kprintfilter>
<kprintfilter name="psnup" >
 <filtercommand data="psnup -p%psl -d1 %filterargs %filterinput %filteroutput" 
/>
 <filterargs name="__root__" description="Multiple Pages per Sheet Filter" >
  <filterarg format="%value" type="bool" name="l" default="" 
description="Landscape" >
   <value name="" description="Portrait" />
   <value name="-l" description="Landscape" />
  </filterarg>
  <filterarg format="-%value" type="list" name="nup" default="1" 
description="Pages per sheet" >
   <value name="1" description="1" />
   <value name="2" description="2" />
   <value name="4" description="4" />
   <value name="8" description="8" />
   <value name="16" description="16" />
  </filterarg>
  <filterarg format="-d%value" type="int" min="0" max="20" name="box" 
default="1" description="Box width" />
  <filterarg format="-b%value" type="int" min="0" max="100" name="margin" 
default="0" description="Additional margin" />
 </filterargs>
 <filterinput>
  <filterarg format="%in" name="file" />
  <filterarg format="" name="pipe" />
 </filterinput>
 <filteroutput>
  <filterarg format="> %out" name="file" />
  <filterarg format="" name="pipe" />
 </filteroutput>
</kprintfilter>