How to setup filters with CUSP printing
Kurt Pfeifle
kpfeifle at danka.de
Tue Jul 18 08:45:40 PDT 2006
Michael Sweet <mike at easysw.com> wrote (Tuesday 18 July 2006 16:13):
> danesh wrote:
>> I wish to resolve a problem whereby the output of my ASCII file is printing as step.
>>
>> I wish to create a filter using shell script that will allow me to put a carriage return at the end of
>> each line. How would I setup a filter on RedHat Linux AS 4.
>
> The following simple filter will do the trick:
>
> "textonly.sh":
>
> #!/bin/sh
> #
> # Interface script for printing text to any printer.
> #
> # This is a standard System V interface script; the arguments are
> # as follows:
> #
> # printer job user title copies options filename
> #
>
> # Parse options...
> copies=$4
>
> # Send the print file...
> copy=1
> while test $copy -le $copies; do
> awk '{print $0 "\r"}' < $6
> echo "\014\c"
>
> copy=`expr $copy + 1`
> done
>
> # Done!
> exit 0
>
> To use it, run the lpadmin command with the "-i" option:
>
> lpadmin -p printername -E -v device-uri -i textonly.sh
Maybe one should add this: "device-uri" in the command above would be
one of
parallel:/dev/lp0
socket://11.12.13.14:9100
lpd://15.16.17.18/<queuename-as-indicated-in-printer-manual>
....
(or similar), depending on the way your printer is connected to the
CUPS server box.
More information about the cups
mailing list