March 26th, 2005
Printing to windows shared printers from Mac OS X

Here we give detailed instructions on how to print on Windows shared printers from the Mac OS X version of Serendipity Blackmagic and Megarip. Instructions are also given for using the printer with the Terminal program as well as any application on Mac OS X. These instructions are for Mac OS X 10.3 (Panther) or later.

Creating the printer on Mac OS X

1. Check the name of the printer being shared by windows. You can do this by checking the share tab of the printer using the windows printer control panel.

Windows Share On Macosx 001
2. On Mac OS X login as a user that has administrative rights. This is normally the user you created while installing Mac OS X.

3. Launch “Printer Setup Utility” from the Applications/Utilities folder.

Printer Setup Utility
4. For Mac OS X 10.3.9 or earlier hold down the Option key while clicking on the Add button. For Mac OS X 10.4 or later click on the “Add button” and then hold down the Option key while clicking on “More Printers”. Select Advanced from the first pop-up menu and “Windows Printer via SAMBA” from the “Device” pop up menu. In the device name field enter any name you wish. This will be used later to access the printer from any application. It is a good idea not to use spaces for the device name as it can cause confusion later.

Printer Setup Utility advanced options
5. in the “Device URI” field enter smb://username:password@servername/printername where username is a valid login for windows, password is the password for

that user, servername is the name or tcp/ip address of the windows computer and printername is the share name as discovered in step 1. For example if your username was tom, your password was piper, the windows computer was called printerhost and the printer was shared as printershare you would then enter smb://tom:piper@printerhost/printershare in the “Device URI:” text box.

Printer Setup Utility device uri
6. From the “Printer Model” pop-up menu select your printer model if available. It is OK to use Generic for printing from Serendipity Blackmagic and Megarip since the printer will only be used to transfer data to the remote printer.

7. Click on the “Add” button and a printer with the name entered in the “Device Name:” text box will be created. You may now quit the “Printer Setup Utility” as it is no longer required.

created printer

Accessing the printer from Serendipity Blackmagic and Megarip

To use the newly created printer with Serendipity Megarip or Blackmagic you will need to perform these additional steps.

1. Bring up the “Workbench” window of “Serendipity Client”. Click on Output and create a new Output that uses an “Output Driver” appropriate for the printer connected to the Windows computer. Change the “Destination Driver” to local print queue. In the “Path” text box enter the name you entered for the “Device Name” when creating the printer earlier in step 7. Save the newly created output and then create a pagesetup with appropriate settings. You should now be able to submit jobs to that pagesetup an they will be printed on the Windows shared printer.

Serendipity Blackmagic Workbench

Accessing the printer from other Applications

Simply print as usual from any Application and the job will appear on the Windows remote printer.


Accessing the printer from Terminal and the command line

You can also use the newly created printer to send files from the command line to the Windows shared printer. Just open the terminal program and type in

lpr -Pprintername filename

where printername is the name you entered for the “Device Name” when creating the printer earlier in step 7 and filename is the file you wish to send to the remote printer.

For the printer created in this document, the command

lpr -Pto_windows_shared_printer /tmp/test.ps

would print the file called /tmp/test.ps to the shared printer printershare on the windows computer called printerhost.

Technorati Tags: , ,

6 Responses to “Printing to windows shared printers from Mac OS X”

  1. [...] printing to windows shared printers from samba – Tried doing this one as well. It uses SAMBA, but I kept getting the NT_XXXX errors, so I gave up on this one. [...]

  2. You are quite right, this entry was written a long time ago for Mac OS X 10.3.2. For Mac OS X 10.4.X what you suggest is indeed correct. I have updated the blog post to reflect this. Thanks for pointing it out

  3. Becky says:

    I am runnning OS X 10.3.9 and the Option key suggestion doesn’t work. Is there anything else you can suggest?

  4. Alfonsmr says:

    Thanks, it was very helpfull to me.

  5. [...] But I still couldn’t print. And then, while searching for instructions that included that little trick with the option key, I found a post entitled Printing to windows shared printers from Mac OS X. I was a bit worried that I didn’t have a password to enter for my pc, but just left it out and it didn’t seem to matter. I almost fell on the floor when the printer shuffled into life. [...]

  6. Pete Carnell says:

    Just found a gotcha that you can fall into. I called my printer name that I made on the Mac

    t1100-hostname

    Every time I tried to print to it with

    lpr -Pt1100-hostname test.ps

    I got the following error –

    lpr: error – unable to print file: client-error-not-found

    Basically this means that the cups cannot find the printer. What happens is cups converts the hyphen characters ‘-’ to underscores ‘_’ – So the printer device is called t1100_hostname but the Printer utility still has the nice name you gave it.
    So I needed to use

    lpr -Pt1100_hostname test.ps

    You can check the name that is being broadcast using

    lpstat -t

    Search through the list and look to see if your printer is listed and check the name. Or just make sure that you use underscores or a short name :-)


Leave a Reply