Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

idontwannareg

macrumors newbie
Original poster
Nov 16, 2003
2
0
Solution for printing from OS X to any printer supported by Linux
=====================================================

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 postcript 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).


Step 1

Install the printer on the Linux box and make sure that it prints properly. (i gave mine the name "printer")


Step 2

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
------------------------------------------------------------------------------

make it executable by running:
chmod 700 /etc/ps2lpr

add the following line to your /etc/rc.local so that it starts when you boot
/etc/ps2lpr &

and so that you don't have to reboot to start testing it, run:
/etc/ps2lpr &


Step 3

Install a new printer (i called it printer3) which uses the Generic Postcript 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 rehat) 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")


Step 4

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).


Step 5

To enable Carbon apps to print postscript that CUPS (pre 1.2) can handle you'll need to install the fix, Printer UnPICTifier, which some legend created and is available from:
http://home.comcast.net/~somers_software/ipp_backend.html


Step 6

Try printing something, preferably from a non-carbon app such as Safari.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.