Our legacy application uses LP commands on Solaris 5.10 to print report files to printers throughout our org. However, now we have a remote location that won't have access to a printer (at least not one on a reliable network) so I'm trying to setup some way for the print spooler to intercept the file, and run the txt2pdf utility on it which is configured to email the output to a specific email address. This way we don't have to go back and change every applications method of printing just for this one location.
We do some custom filters in these old print spoolers for various things, so i thought i could use that to, instead of adding form feeds to the job like one of our current filters, instead run the file through txt2pdf and then just output to a null printer.
case "$TERM" in
PS )
# make the "postscript" printers use postio to
# talk to the printer and periodically get a
# status from them
FILTER="/usr/lib/lp/postscript/postio"
;;
pptestterm)
FILTER="/usr2/dms/run/txt2pdf/txt2pdf - -landscape|lp -s -d NULL"
;;
(the lone '-' in the txt2pdf command tells it to use stdin and stdout)
Obviously this is not working and i'm struggling to find the understanding of exactly how LP applies these interfaces/filters.
This is the error msg in the logfile when the above configuration is used:
06/04 14:56:53: printer fault. type: write root, status: c
msg: (txt2pdf: couldn't open temporary file ./txt2pdf18653)
Any recommendation on how this can work?