Beat Rubischon on Mon, 28 Aug 2000 11:01:05 +0200 (CEST)


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

Re: apsfilter 6.0-devel: more options for -Z


Hello!

On 25.08.00, Andreas Klemm wrote:

> > > I'd even do it immediately today if you like ;-)
> > Don't stress! I'll send you the changes on moday. Get well soon!
> Send it now if you like, then I have finished for the weekend.

Well, I was too tired on friday to finish the script. You'll find
it attached to this mail.

> BTW, apsfilter now supports duplex printing !

Cool!

On 26.08.00, Andreas Klemm wrote:

> I'm not sure where exactly to locate the options ...

Ok, let me explain how our students - aehm users - prints their
files:

Usually, the use:
$ lpr myfile.ps

Now, when they like to print duplex, they use:
$ lpr -Zduplex myfile.ps

2 pages on one is often used:
$ lpr -Z2up myfile.ps

or to save parts from our rainforest:
$ lpr -Z2up,duplex

or if they like to select alternate tray:
$ lpr -Z1 myfile.ps

finaly, they print also books:
$ lpr -Zbook myfile.dvi

Everything is done by the -Z (-C for BSDlpr?) parameter. I don't
think that this should be a parameter for apsfilterrc. Well, they
_can_ be used :-)

> For what printer are they exactly ?
> I assume for true PS printers, or ?

The filters out of psutils are inserted before "gs". They should
be working also for non-PS-printers. Well, I'm not sure if gs is
able to set duplex and papertrays also for non-PS-printers...

The problem is, that I don't have access to printers with more
then one tray or a duplex engine without PS ;-)

> I applied your diff (which in the meantime not applied cleanly)

You're too fast with developing ;-)

> and moved the options around a bit ..., look patch applied.
> Is it correct that way ?

Well, you have moved the "option case" after "PostScript printer
options". I think at least psnup and psbook also works for
non-PS-printers and - if gs is clever enough - the duplex and
tray-selection should also work for non-PS-printers.

> Could you please also document your new options in man/apsfilterrc.1
> please ?

Ooups! I don't know roff... But I would learn it if you think,
this are options for apsfilterrc :-)

If you like, I can make a diff against the cvs-version. Give me
just a bit of time to check if everything still works as it
should be.

Greetings Beat

-- 
Beat Rubischon				<rubischon@phys.ethz.ch>
Informatiksupport			phone:      01/633 41 89
Departement Physik, ETH Zuerich		mobile:    079/347 27 03
#!/bin/sh
#
# This script inserts the nessecary commands to select
# a papertray into a ps-stream.
#
# 8.2k Beat Rubischon <rubischon@phys.ethz.ch

if [ "$1" = "" ]; then
  echo "$0 [traynumber]" >&2
  echo >&2
  echo "inserts the nessecary commands to select" >&2
  echo "a papertray into a ps-stream." >&2
  echo "traynumber starts usually with 0." >&2
  exit 1
fi

tray=$1

insert="\
%%BeginSetup\n\
statusdict begin\n\
$tray setpapertray\n\
end\n\
%%EndSetup"

awk "{ print }
/^\%\%EndProlog\s*$/ { print \"$insert\" }"
pstray - select a papertray

This script inserts a papertray selection into a postscript stream provided
in STDIO. I used it on several HP (IIIsi, 4000, 5000) and IBM (NP 17)
printers.

Usually, the trays are counted in the manuals and on the printer beginning
with 1. On the postscript-side, it's started with 0.

Usage:

$ pstray 1 < tiger.ps | lpr

  -> Should take the paper for tiger out of the second papertray.

or with apsfilter:

$ lpr -Z1 tiger.ps

  -> like the upper exapmle.

Beat Rubischon <rubischon@phys.ethz.ch>