Sharing a Ubuntu printer to Windows

I'm running a Ubuntu machine in my office that has a HP LaserJet 1320 Printer. My home and kids machines run Windows and occationaly need to print. Before I installed Ubuntu this wasn't a problem as everything was Windows.

Install samba and smbfs

sudo apt-get install samba smbfs

Edit the smb.conf file

sudo emacs /etc/samba/smb.conf

First, I modified the [printers] section and marked the following two items to yes.

[printers]
    browseable = yes
    quest ok = yes

Then, I uncommented and modfied the following inside the ### Printing ### section

########## Printing ##########

# CUPS printing.  See also the cupsaddsmb(8) manpage in the
# cupsys-client package.
   printcap name = cups
   printing = cups
   security = share

Restart Samba

Lastly, you only need to restart samba.

sudo /etc/init.d/samba restart

After this you can go into Windows > Printers -> Add Printer and find your printer by browsing the network.

References