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:
- 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)
- Then with a Microsoft machine,
- go to the printer share
- right click in the folder and select Server Properties
- 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:
- Push Windows Printer Drivers with CUPS by Carla Schroder
together with both cups man pages:
and finally with the Windows Driver
For me there was two major points:
- 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.
- with the cupstestppd command and correcting all errors
- helped by the adobe PPD Spec V4.3
- 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 .