[SUMMARY] Printing to a file

From: Daniel Denes <Daniel.Denes_at_bg-sys.de>
Date: Mon Mar 01 2004 - 09:49:08 EST
Got two helpful answers.

Jim Vandevegt suggested to
- Create an interface script with the following content:
## --------------------- BEGIN SCRIPT ------------------------
#! /bin/sh
reqid=$1
shift; shift; shift; shift; shift
files="$*"
for file in $files
do
        fname="/my/output/directory/`date '+%d%H%M%S'`.`basename $file`.$reqid"
        cp "$file" "$fname"
done
exit 0
## --------------------- END   SCRIPT ------------------------
- add a new printer to the system (lpadmin -p <PrinterName> -v <SomeExistingFile> -i <PathToTheInterfaceScript>
- and dont forget to do
accept <printer>
and
enable <printer> (shame on me! ;)
REMARKS:
--------
Replace the path in the script with something suiting your needs;
if "enable" doesnt seem to work it may be due to enable being a bash
builtin. Use /bin/enable or /usr/bin/enable then.
Solution works fine for me. Thanks Jim.

John Malick's solution was to simply add a printer whose device is
really an (existing) text file, as in
- touch /var/tmp/Prt
- lpadmin -p MyPrt -v /var/tmp/Prt
REMARKS:
--------
As John pointed out, that file you specify as the device has to exist
already. Text is being appended as you print. Unfortunately i was not
able to set the printer up to work without a banner page.

Finally i want to thank
Brendan Doherty <Brendan.Doherty@prebon.com>
"Hargett, Jack" <jack.hargett@bankofamerica.com>
john.warr@bellsouth.com
"Champagne, Robert" <Robert.Champagne@emergis.com>
SANTA Giovanni <giovanni.santa@globalvalue.it>
Meier Adrian <ADRIAN.MEIER@T-SYSTEMS.CH>
Leo Chow <leo@icil.net>

for letting me know tehy are out of office. I hope you're having a
great time guys.

Thanks to all who helped again,

dd
-- 
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
Received on Mon Mar 1 09:49:00 2004

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:43:26 EST