Print to Windows NT PostScript printers

Jun 27, '02 09:59:41AM

Contributed by: BraindeadMac

I recently needed to print to our HP Laserjet 4050 which is set up as a networked printer connected by parallel port to a Windows NT 4.0 PC. The smbutil utility included in OS 10.1.x doesn't support print very well, apparently, and I was never able to successfully print with it. The complete Samba package does allow printing to Windows NT 4.0 machines, so I decided to try that. It's actually pretty easy to do. I've only done this with postscript files to a PostScript printer.

Read the rest of the article for the how-to...

  1. Build and install samba using the directions at Apple. You won't need to setup or install the Startup Items if all you want to do is print. You might also tell the installer to put Samba in /usr/local instead of in /usr/bin. The main application needed is the smbclient application.

  2. Create a smb.conf file and place it in /etc/samba/; you can use the one on the above Apple opensource site as a starting point. All you need to do is define the global stuff like workgroup and NETBIOS name. You can pick any non-special character name here meeting the NETBIOS name requirements.

  3. Make sure you have a PostScript printer queue setup on your PC. I'm not much of a Windows guy, but even I was able to do it, so it's not hard. Of course you need a Postscript compatible printer or interpreter on the PC...

  4. You now need to generate a Postscript file. From any OS X application, choose Print, then from print options you need to choose "Output Options" and click "Print to File". There are two options to save the file ("PDF" or "Postscript"); select Postscript. Then save the file with whatever SMB compatible name you want -- keep it simple, though. If you want to print a text file, you can use the "enscript" command, for example enscript -p test.ps /etc/samba/smb.conf.

  5. From the command line, run smbclient, here's an example logging into the NT server "DAMMIT" with its printer queue "HPLaserJetPS":
    [PBG4:~] 172% smbclient //DAMMIT/HPLaserJetPS -U Administrator
    You will then be prompted for the password -- this is the user password for the remote computer. If all goes well, you'll be logged in and you'll print the file you made in step four. For example:
    smb: > print test.ps
    If it works, you'll get a message:
    putting file test.ps as test.ps (771.2 kb/s) (average 771.2 kb/s)
This could probably be setup as a print queue, but it seems like folks are having mixed results defining with these in OS X, and it wasn't worth the effort for me.

Comments (4)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20020627095941186