SUMMARY: Filtering input to a remote printer

From: Mark Norman (NORMANM@kiwi.co.nz)
Date: Wed Jul 17 1996 - 18:33:38 CDT


Hi all,

Thanks to:
Martin Achilli, Yaron Hemi, Danny Johnson, Sherman Schorzman, Don
Catey, Matt Hill, Milt Webb and Don Lewis for their helpful suggestions.

In the end, I followed Danny's advice (and Matt and Milt's too) to write a
filter which processed the data as I wished then passed it on to another
print queue. I wrote a simple awk script to add CRs to each line and then
bung a formfeed on the end of the last page, then lp'd the file to a queue
which pointed to the remote device. Here's the relevant line from the
interface file:

    /usr/macros/u2dprtfilter "$file" | lp -dremotequeue

where remotequeue is the simple queue which pipes the data to the
network printer adapter. The contents of /usr/macros/u2dprtfilter (yeah
ugly name I know) are:

---
#!/usr/bin/nawk -f 

# u2dprtfilter -- filter to convert LFs to CR/LFs then add an FF at the end { print $0, "\r" } END { print "\f" } --- simple huh? The command I used to add the first queue (which users specify when wanting to print) was:

lpadmin -p printername -i /etc/lp/model/printername -v /dev/null

I put the filter I wrote in /etc/lp/model, of course.

Any more questions, I'd be happy to answer them. I get the feeling that this was a bit of a quick and dirty method, but it was the simplest solution that I could come up with.

Regards Mark Norman

Original query follows: ---------------------------------------------------------------------- Hi all,

I have a printer which is connected to a TCP/IP network via a little adapter with just enough brains to make itself known as a host and shove print jobs through to the printer it's plugged into. Unfortunately this box isn't clever enough to add carriage returns to linefeeds; since it's a remote printer I can't make an interface for it, I assume. Is there any way around this problem? FYI, I'm using Solaris 2.4.



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:11:05 CDT