Print from OS X to any Linux-supported printer
Nov 25, '03 09:41:00AM
Contributed by: Anonymous
My problem was that I couldn't print from an OS X 10.2.8 G4 laptop via the network to my Samsung ML-1710 which is plugged into my WinXP PC . Apparently the Samsung OS X drivers only work for printers connected via USB. This solution can be used to enable a Mac to print to any printer that Linux can print to.
The CUPS ML-1210 driver on my Linux PC works fine with the ML-1710, so I decided to use it to act as a PostScript translator so that the Mac could print to it using generic PostScript, and then send the job on to the printer on my WinXP PC (or it could just as well be a printer connected locally to the Linux box).
Read the rest of the hint for the solution...
- Install the printer on the Linux box and make sure that it prints properly. (I gave mine the name "printer").
- Login as root on your Linux box and create the following script. I saved it in /etc/ps2lpr but thats probably not the most ideal spot:
#!/bin/bash
# delete the fifo pipe (in case it already exists)
rm -f /dev/ps2lpr
# create a fifo pipe to send print jobs to
mkfifo /dev/ps2lpr
# make things easy
chmod 666 /dev/ps2lpr
while true
do
# redirect any job sent to /dev/ps2lpr to the lpr command
# so it prints on the printer called printer
lpr -P printer < /dev/ps2lpr
done
Now make it executable by running chmod 700 /etc/ps2lpr, and add /etc/ps2lpr & to your /etc/rc.local so that it starts when you boot. So that you don't have to reboot to start testing it, run /etc/ps2lpr & at the prompt.
- Install a new printer (I called it printer3) which uses the Generic PostScript driver and make it print to the local device /dev/ps2lpr. In the CUPS web GUI, you can't specify a custom device so you'll need to hand edit /etc/cups/printers.conf so that you get DeviceURI file:/dev/ps2lpr for your printer.
You could add the printer in the web GUI and initially select the parallel port and then go back and edit the file, or do it the easy way and just use redhat-config-printer (if you've got Red Hat) which allows you to add a custom device. Don't forget to restart CUPS if you edit the conf file by running /etc/init.d/cups restart.
- If CUPS browsing is enabled on both your Linux and OS X box, then the new printer should just appear in the Print Center in OS X. If not, you'll have to add a "Generic" printer and point it to your linux box using a URI such as:
ipp://mylinuxserver/printers/printer3 or maybe printer3@mylinuxserver.
Hold down Option when you click Add to get the Advanced settings.
- To enable Carbon apps to print PostScript that CUPS (pre 1.2) can handle, you'll need to install Printer UnPICTifier, which some legend created.
That's it! Now try printing something, preferably from a non-Carbon app such as Safari.
Comments (3)
Mac OS X Hints
http://hints.macworld.com/article.php?story=20031116123729506