Michal Szymanski on Tue, 9 Apr 2002 09:47:06 +0200 (CEST)(envelope-from owner-apsfilter-help@apsfilter.org)


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: passing options to subfilters?


On Mon, Apr 08, 2002 at 07:46:47PM +0200, Michael Loßin wrote:
> On 04-Apr-02 Michal Szymanski wrote:
> > Is it possible to dynamically control the subfilter (like a2ps) used by
> > apsfilter and be able to pass options specific for a2ps in the
> > "lpr" command line?
> 
> In general, no. The apsfilter script most likely is running
> under a privileged user, so we must not allow arbitrary
> options (to any subfilter) to be used. We did allow a similar
> construction once and ran into serious security problems.

Oh, this is understandable.

> 
> But if you can explain which a2ps option you actually want
> to use, maybe we can create a special switch for it.

Would be nice. The topic I am thinking about, is "pretty printing". With
the default setup (of apsfilter and probably also of a2ps) I get some
files (e.g. C programs starting with #include) printed
syntax-highlighted, in color on a deskjet printer. This is not always
desirable. It would be nice to have an option to control pretty
printing: nopp, pp, color-pp. Color might be controlled by already
available options, provided that the use of "mono" option changed also the
options for a2ps (or any other ascii subfilter chosen by the user). This
is because "mono" pretty printing uses bold, italics etc. and the result
would be totally different if we just process color-PS (made by a2ps
with color pretty printing) file through ghostcript with "mono" option.

> Another approach would be to perform the necessary steps
> *before* sending the stuff to the spooler, i.e.
>         a2ps -my -options my_file | lpr -P my_printer

Sure I can do this :) I'm just lazy :)

> > And, BTW, could somebody explain how does 'apsfilter' construct options
> > passed to 'a2ps'? There are at least 2 variables in apsfilterrc:
> > 
> >#A2PS_BASIC="--delegate=no -X iso1 -g"
> >#A2PS_BASIC='-X iso1'
> >#A2PS_OPTS='-X iso1 -m --borders=yes --prologue=color
> >#--highlight-level=heavy'
> > 
> > It seems as if A2PS_OPTS included A2PS_BASIC, but what will happen if I
> > uncomment (and change) both?
> 
> A2PS_OPTS does actually overwrite the complete command line
> and will be used if it is set (with only "-q -o -" added,
> so the output will be properly sent to stdout).
> 
> A2PS_BASIC is used to supply a basic set of options that are
> extended with (the file specific set of) paper size, color,
> file type, ... parameters.

Thanks for explanation. One more question: what are the default options
passed? At first, I thought that the commented options give defaults but
surely they do not (e.g. text is printed w/o borders!)

regards, Michal.

-- 
  Michal Szymanski (msz@astrouw.edu.pl)
  Warsaw University Observatory, Warszawa, POLAND