User Tools

Site Tools


operating_systems:linux:debian:cupsaddsmb

cupsaddsmb: How to add cups printers to samba

There is many ways to add cups printers to samba and for a long time I used the “common” solution:

  1. Add the printer to cups either
    • through the interface
    • or by editing the /etc/cups/printers.conf file and manually adding the ppd into the /etc/cups/ppd directory (e.g: if declared <Printer HP_Laserjet_6MP> then the ppd filename is HP_Laserjet_6MP.ppd)
  2. Then with a Microsoft machine,
    1. go to the printer share
    2. right click in the folder and select Server Properties
    3. go in the drivers tab and click the Add… button in order to add the windows driver in the server. This driver will be uploaded in the samba print$ share (e.g. the /var/spool/cups/drivers directory) under the W32X86/3 sub-directory.

But this solution implies one driver for linux and another one for windows. This lead to driver version problems and others. So there is another solution based on the cupsaddsmb tool provided by the debian cups-client package.

This website provides a good explanation to start:

together with both cups man pages:

and finally with the Windows Driver

For me there was two major points:

  1. Testing both the original ppd (provided by the manufacturer) found under the /etc/cups/ppd directory and the one generated by cupsaddsmb found under the /var/spool/cups/drivers/W32X86/3 directory.
  2. Setting the driver owner/rights in the samba print$ share (/var/spool/cups/drivers/W32X86/3) which is usually root:lp and 644

:!: Each time you call the cupsaddsmb tool, the windows ppd file in the /var/spool/cups/drivers/W32X86/3 directory is modified!

Finally a short word about a problem while printing pdf through Adobe Acrobat Reader causing an OFFENDING COMMAND: findresource error. There is a workaround which is clearly described by Michael D. Valentine in the post entitled Acrobat to Samba to CUPS to Papercut to Lexmark...What could possibly go wrong?. The solution is to add a key (“bOptimizePSForSpeed”=dword:00000000) in the registry under the HKEY_CURRENT_USER\Software\Adobe\Acrobat Reader\8.0\Originals section. This will preset adobe acrobat for sending Font and Resource Policy with the Send for Each Page option. This option is usually found in the Advanced tab of the adobe acrobat Print window .

operating_systems/linux/debian/cupsaddsmb.txt · Last modified: 2012/08/26 10:59 by sbolay