This excerpt was COPIED from a link over at
http://www.macosxhints.com and I don't know if it works because I haven't tried this yet.
Setting up lpd printing on OS X
Fri, Dec 21 '01 at 10:33AM ? from: eagle lpd is the standard Unix printing system, so others who come from the Unix community (as I did; a longtime Linux and NeXT user) might be interested in sharing their printers to their other Unix machines.
See, not having lpd as the printing system in OS X was a big bummer to me, because it meant that I could no longer print with my NeXT and other Unix computers, because my printer is now hooked to my G4 Cube (permanently assigned to OS X 10.1). With this little hacked up lpd, I can now do that again.
Read the rest of the article for the how-to.
[Editor's note: I have not done this on my machine as of yet, but Daniel vouches that it works. Any errors in the following article are a result of my formatting work; please let me know if you see any troublesome lines!]
Here's how to get lpd working:
1] Create the printcap entry. Here's the entry I used:
lp: \
:sh=truef=/Users/foo/Applications/lpd-hack: \
:lf=/var/log/lpd-errs:sd=/var/spool/output/lpd:lp=/dev/null:
The options are:
* sh=true -- suppresses the header page (sh=true is required to print PostScript and PDF files)
* of=.../lpd-hack -- this is the Output Filter that lpr will use. This is what actually prints the file. The of parameter must point to the actual executable script.
* lf=/var/log/lpd-errs -- this was in there by default and I didn't remove it
* sd=/var/spool/output/lpd -- the spool directory; needs to be a valid directory
* lp=/dev/null -- the device where the printer exists; I use /dev/null because I have no printer device!
After you have edited /etc/printcap, simply run:
niload printcap / < /etc/printcap
2] Save the following as the script pointed to by the "of=" parameter above
#!/usr/bin/env perl
$temp_file = "/tmp/printing.$$";
# LPD passes via STDIN the file to be printed
# (we don't have any knowledge of the original filename...too bad)
# save this as a file to be processed
@lines = <STDIN>;
open(TMPFILE,">/tmp/printing.$$");
print TMPFILE @lines;
close(TMPFILE);
`/usr/sbin/Print /tmp/printing.$$`;
`/bin/rm -f /tmp/printing.$$`;
Don't forget to make the script executable.
3] Start lpd. lpd resides at /usr/libexec/lpd. Simply run "/usr/libexec/lpd" as root from the command line.
4] Restart the queue. Run "lpc" and issue the command "restart all" then exit lpc.
5] Now print. Make sure the $PRINTER environment variable matches the name of the printer in the printcap entry. The default printer is "lp" so if you use the above, you need not set $PRINTER. Print using the command lpr, as in:
lpr file.txt
lpr file.ps
lpr file.pdf
With this setup, you can print text, PostScript and (!) PDF files. Additionally, you can share a networked printer. Simply add the remote machine's DNS name (haven't tried IP address yet but I would bet that it works) to /etc/hosts.lpd or /etc/hosts.equiv on the OS X box, you can configure /etc/printcap on the remote machine and use lpr/lpd on the remote machine to spool to a printer on the OS X box.