Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Sharing a printer with UNIX machines UNIX
Here's the situation: I have a Mac OS X box on a network with a printer. Everything works fine. I share this printer happily with other Mac OS X systems. But printing from Debian causes problems. The first steps are well known, so I won't dwell on them. Install the cups-client software on the UNIX box, and edit /etc -> cups -> client.conf so it has:
ServerName <OS X Print Server>
DefaultPrinter <Printer Name>
In my case the printer name was Lexmark_Z25_Z35. You should now be able to execute:
lpr <text file>
But there is a problem. Most UNIX apps (eg Mozilla) will send PostScript, but the OS X print system is PDF based, and will essentially send the print job to /dev/null because it can't change the input to PDF. This is where I was stuck. The UNIX people had to save the print job to a file, then use ps2pdf to convert it before sending, or change the print command in each app. Annoying, and I couldn't find a solution anywhere.

Well I managed it myself. First get epspgs from Gimp-Print, or install it via fink. This will give you the ps2pdf tool. Next create pspdffilter in /usr -> libexec -> cups -> filter, and paste these contents:
#!/bin/sh

export PATH=$PATH:/usr/local/bin
PS2PDF=ps2pdf

if test "x$6" == "x"
then
  exec $PS2PDF - -
fi

exec $PS2PDF $6 -
You'll need to change the path if you used fink. Save and make this file executable, i.e. chmod a+x pspdffilter. Now create the file ps2pdf.convs in /etc -> cups:
application/postscript    application/pdf 33 pspdffilter
And finally, killall -HUP cupsd. It should now work. It needs some refinement, specifically logging and page accounting (see writing cups filters for more information), but I'm happy!

[robg adds: I have not tested this one...]
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[7,926 views]  

Sharing a printer with UNIX machines | 5 comments | Create New Account
Click here to return to the 'Sharing a printer with UNIX machines' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Sharing a printer with UNIX machines
Authored by: gvaughn on Apr 10, '03 11:36:09AM

I'd like to point out a great resource that doesn't seem to be widely known: <http://linuxprinting.org/macosx/>

It has easy to install OS X versions of printing utilities. Gimp-print is the most widely known, but I've had better luck with hpijs for HP printers.

Regarding the sharing of non-postscript printers, I just found a solution for my obscure needs a couple of weeks ago that might simplify your setup. I'm not using printer sharing, but instead doing a unix lpd (I hope that's the right name, might technically be lpr) server on my OS X box. You ought to be able to use PPD-o-matic (see below) to simplify your Debian setup.

I have an HP 5550 attached to the print server of an SMC router. With the above mentioned hpijs driver, my OS X machine printed without a hitch. However, the OS 9 machine was a bit of a problems. Desktop Printer Utility assumes PostScript printers. I used PPD-o-matic <http://www.linuxprinting.org/ppd-doc.html> to create a PPD file to use on the OS 9 machine for the HP 5550. Then I followed the instructions at <http://www.macosxhints.com/article.php?story=20030121062249804> to setup an lpd daemon on my OS X machine to act as a postscript RIP on behalf of the OS 9 machine. My jaw dropped when it worked flawlessly the first time I tried to use it.



[ Reply to This | # ]
Important For Graphics Professionals!
Authored by: nvdingo on Apr 10, '03 12:46:30PM

this hint and the previous comment by gvaughn essentially tell you how to set your machine up as a Postscript RIP/printserver for ANY PRINTER!

of course you might not get the quality of a paid for RIP for your printer.
you get the savings.

with gimp-print installed, and fine-tuning the ink settings in printer setup files, you might actually get better quality, for free.

your mileage may vary, but for simple postscript layout proofing, and not color proofing, this makes working in many programs that produce postscript output under OS 9, a whole lot cheaper! (not having to buy postscript rip software for your epson, or HP or canon, or whatever cheap cheap inkjey you want to use)



[ Reply to This | # ]
Sharing a printer with UNIX machines
Authored by: ssevenup on Apr 10, '03 01:31:51PM

Anyone have any idea how printers like our HP8550 that claim to handle PDF natively play into this equation? I have never found any evidence that any jobs are being sent to the printer as PDF, or how that might be accomplished. I have never seen any way to get OSX to send PDF straight to the printer. I also have no idea if the printer handles both binary and ascii format PDF. Obviously if the printer is on the network the Debian box could just send the job direct, but I still am interested in the answers assuming it were connected to an OSX box acting as a print server as described here.

--MM


---
Mark Moorcroft
ELORET Corp. - NASA/Ames RC
Sys. Admin.



[ Reply to This | # ]
Sharing a printer with UNIX machines
Authored by: fogweasel on Apr 11, '03 12:58:56AM

Another way is to use the Save as PDF button in the Print dialog, then open the resulting PDF in Acrobat Reader - you have a fair degree of control over printing parameters there.



[ Reply to This | # ]
Sharing a printer with UNIX machines
Authored by: tres on Apr 11, '03 02:12:27AM
This isn't directly related to this hint, but right now, the "put server name in cupsd.conf" answer is the only one that seems to be out there, and it really defeats the whole point of Rendezvous to begin with. If you've got a laptop that you're moving between networks, setting a server name in cupsd.conf just isn't the best way to go.

Using a CUPS server doesn't require that you have to manually enter the server name into the cupsd.conf file of your Mac. In order to get CUPS working with Rendezvous, you've got to do two things: define a browse address on the print server and have a way to translate IP addresses into host names. You can do this through DNS or through /etc/hosts and netinfo. (Although using a static /etc/hosts and netinfo database also defeats the purpose of Rendezvous.)

First, To set up Rendezvous so it will work, just make sure that your CUPS print server has a browse address turned on:
Look for a section of cupsd.conf that looks something like this, and enable the appropriate choice for your situation.

    #BrowseAddress x.y.z.255
    #BrowseAddress x.y.255.255
    #BrowseAddress x.255.255.255
    #BrowseAddress 255.255.255.255
    #BrowseAddress @LOCAL
    #BrowseAddress @IF(name)
On my FreeBSD CUPS server, I have the following:
    BrowseAddress @IF(fxp0)
Second, make sure that your client machine "sees" your print server as the name you have defined for the server. The easy way to do this is to make sure that netinfo has the host machine name /IP address combination in the /machines section of your Mac's Netinfo database. Do this with the Netinfo manager, or nicl.
My preferred method here is to set up a Tiny DNS dns cache/dns server combo, but you can use BIND or whatever you want.

Setting up static host entries is great if you've got a bunch of desktops that you're hooking together, but if you've got a laptop that you plan on moving to different networks which may or may not have the same private addresses, defining hosts in Netinfo, or in /etc/hosts may get you into trouble (the chances are small, but they are there). If you're using a Linksys router or some other "dumb" router to provide IP addresses for your subnet, then forget it; you've either got to go to a static IP scheme, or set up your UNIX/Linux/Mac OS X print server to provide DCHP services that have IP addresses associated with MAC addresses for your network hardware.

Surely not as easy as the old chooser, but once it's set up, you can do lots of other magic with machines on your network. It also means that servers like CUPS and SSHD, which rely on hostnames, will work correctly.

[ Reply to This | # ]