How to print to filtering CUPS queues from network hosts?


Author: Robert van den Aker (robert2 AT dds DOT nl)
Contributors: Nigel Gent (Mac OS X section)
Version: 2006.06.14.0

Introduction

All filtering printer queues in CUPS accept PostScript as input. In fact, if the input is not PostScript, it will be converted to PostScript before being RIPped (put through a Raster Image Processor) to a printer-ready raster format if you have a non-PS printer, or sent straight to the printer if you have a PS printer. For practical purposes all filtering printer queues can be considered PostScript printers. This means you print to them through PostScript drivers. To control printer options you use PPD's (PostScript Printer Descriptions), just like you do with real PostScript printers. What follows are instructions to install and/or configure PS drivers and PPD's on a number of popular operating systems.

Printing to filtering queues from Linux (and other Unix) hosts works slightly differently. They can send the printable files straight to the remote filtering queue without pre-filtering them to PostScript locally.

Printing from Windows 95/98/Me through Samba

  1. Make sure that you've added at least one filtering queue and that you've "synchronized the printer lists" from the server-manager's printer panel.
  2. Download the "Adobe Universal PostScript Windows Driver Installer" or the "PostScript Printer Driver AdobePS x.x.x for Windows 95 and Windows 98" from this page (I prefer the latter, the former seems to ignore PPD options randomly). Keep the installer handy: you need to run it every time you wish to add a PostScript printer.
  3. Run the installer. When asked where the printer is, simply browse to the printer queue on your SME Server's Samba share. When asked where the PPD is, choose "Network" and temporarily map an unused drive letter to \\SERVERNAME\PRIMARY, then browse to files/cups-ppds on this drive. When the installer finishes, it asks whether you'd like to configure driver options. Say yes to this and change the "PostScript output format" on the "PostScript" tab from "PostScript (optimize for speed)" to "PostScript (optimize for portability - ADSC)".
  4. Repeat the previous step for all printers.

Printing from Windows 95/98/Me over IPP

  1. Download the Internet Print Services client software from Microsoft's site and install it. For Windows 95 the download is on this page. For Windows 98 get the download from this page. Windows Me reportedly shipped with an IPP client in the Add-Ons folder on the CD-ROM. Alternatively, the Windows 98 client will probably work on Windows Me as well.
  2. Make sure that you've added at least one filtering queue and that you've "synchronized the printer lists" from the server-manager's printer panel.
  3. Download the "Adobe Universal PostScript Windows Driver Installer" or the "PostScript Printer Driver AdobePS x.x.x for Windows 95 and Windows 98" from this page (I prefer the latter, the former seems to ignore PPD options randomly). Keep the installer handy: you need to run it every time you wish to add a PostScript printer.
  4. Run the installer. When asked where the printer is, enter as the network path http://servername:631/printers/printername. When asked where the PPD is, choose "Network" and temporarily map an unused drive letter to \\SERVERNAME\PRIMARY, then browse to files/cups-ppds on this drive. When the installer finishes, it asks whether you'd like to configure driver options. Say yes to this and change the "PostScript output format" on the "PostScript" tab from "PostScript (optimize for speed)" to "PostScript (optimize for portability - ADSC)".
  5. Repeat the previous step for all printers.

Printing from Windows NT4/2000/XP through Samba

You can either install the Adobe PostScript driver and basically follow the instructions for the other Windows versions, or you can install the cups-samba package, which contains a free PostScript driver for Windows NT4/2000/XP from the makers of CUPS, and use the cupsaddsmb command as explained below. The cupsaddsmb command exports the PostScript driver from the cups-samba package and the PPD('s) associated with your filtering CUPS queues to the Samba printer drivers directory, making them available for semi-automatic download to Windows NT4/2000/XP hosts.

  1. Make sure that you've added at least one filtering queue and that you've "synchronized the printer lists" from the server-manager's printer panel.
  2. Install the cups-samba package, which provides a freely distributable PostScript driver for Windows NT4/2000/XP, with yum (this assumes you have added the 'rvandenaker-cups' repository to your yum configuration).

    [root@hostname ~]# yum install cups-samba

  3. Set "use client driver = no" in smb.conf through the UseClientDriver database property.

    [root@hostname ~]# db configuration setprop smb UseClientDriver no

    [root@hostname ~]# expand-template /etc/samba/smb.conf

    [root@hostname ~]# service smb restart

  4. Run cupsaddsmb from the root prompt to "export" your printers. You can export individual printers with the command line

    [root@hostname ~]# cupsaddsmb -U admin -v printer1 [printer2...printerX]

    or you can export all printers at once with the command line

    [root@hostname ~]# cupsaddsmb -U admin -v -a

    These command lines connect to the samba server as admin, so you need to supply the admin password when prompted.

  5. Printer setup on your Windows NT4/2000/XP hosts should now be a "Point 'n Print" affair. Just browse to a printer on your SME Server share, right click on it and select "Install..." or "Connect..." (depending on Windows version).
  6. Repeat the previous step for all printers.

Printing from Windows 2000/XP over IPP

Get the PostScript driver and PPD onto your Windows system by first installing the printer as a Samba printer following the instructions above, then change the printer port to http://servername:631/printers/printername.

Note that Microsoft does not seem to provide IPP software for Windows NT4. Some other companies do.

Printing from Mac OS Classic through netatalk

The PostScript driver in Classic Mac OS is called "LaserWriter 8". It loads most CUPS PPD's correctly, but chokes on Gimp-Print PPD's. Please see this thread on the Gimp-Print support forum for a workaround.

  1. Make sure that you've added at least one filtering queue and that you've "synchronized the printer lists" from the server-manager's printer panel.
  2. On your Mac open the Chooser from the Apple menu, click "AppleShare" and connect to your SME Server. Choose the "Primary" share.
  3. In the "files" folder on "Primary" you'll find a folder called "cups-ppds", which contains the PPD's of all the printers you've configured in CUPS.
  4. Copy the PPD('s) of the printer(s) of your choice to System Folder:Extensions:Printer Descriptions.
  5. Go back to the Chooser and click "LaserWriter 8". Select each printer in turn and press the "Setup..." button in the Chooser pane. The printer will be automatically configured to use the PPD that you copied to the "Printer Descriptions" folder. The options that are specified in the CUPS PPD are now available as "Printer Specific Options" in Mac OS print dialogs.

Printing from Mac OS X over IPP

Note: this applies to the latest version of Mac OS X and may not apply to earlier versions.

  1. Make sure that you've added at least one filtering queue and that you've "synchronized the printer lists" from the server-manager's printer panel.
  2. Add your Mac's IP address to the "TrustedHosts" property for the cups entry in the configuration database as explained here.
  3. The printers you configure on your SME Server now appear as "Shared Printers" in your Mac's print dialogs. No local configuration is required.

Printing from Linux over IPP without a local spooler

With this method your Linux host is an IPP client only and doesn't run any print spooler/server itself.

All the Linux IPP clients that I'm aware of use libcups, the IPP library from the CUPS software distribution. Unfortunately, most of these frontends do not expose all the functionality that is provided by libcups. In particular, the ability to specify a user name and server name is not provided by most frontends. Even the frontends that ship with the CUPS 1.1 distribution (the commands lp, lpr, cancel, lprm, lpstat, etc.) do not uniformly allow the user to specify a remote server and/or user name. This is a problem because the default configuration of the CUPS server on SME Server is to require authentication from all remote clients. You can work around this problem by adding the client system to the "TrustedHosts" in the SME Server's CUPS configuration. Possibly the problem can also be solved by using NIS to duplicate users between SME Server and client systems. Alternatively, you can use GtkLP or XPP, which AFAIK are the only libcups frontends that do allow users to specify remote server and user names. Of these two, GtkLP is the most mature application. Unfortunately, configuring your Linux desktop to use GtkLP consistently across all applications as the default printing client can be a bit of a challenge.

Here's an example of a client-only configuration with a standard Ubuntu desktop installation. Assume that SME Server is 192.168.0.1 and the Ubuntu system is 192.168.0.123.

  1. On the SME Server add the Ubuntu system to your TrustedHosts for cupsd:
    [root@hostname ~]# db configuration setprop cupsd TrustedHosts 192.168.0.123
    [root@hostname ~]# signal-event cups-reconfigure
  2. On the Ubuntu system edit /etc/cups/client.conf and add the line:
    ServerName 192.168.0.1
  3. Optionally, you can stop the cupsys service on your Ubuntu system because there is no need to run a CUPS server on the client system.

Printing from Linux through a local CUPS spooler

In this configuration the local CUPS server hands print jobs to the remote CUPS server (the one running on your SME Server) through the IPP backend. This poses a problem for authentication. When the local server accepts a print job from the local client, it will try to submit the job to the remote backend "for" the submitting user, not "as" the submitting user. The local server can't authenticate to the remote backend for the local user. Of course, the local user could authenticate and print to the remote server directly by pointing his/her local CUPS client to the remote CUPS server, but if you want to print through the local CUPS server and use the remote CUPS server as an IPP backend I see no other solution than to disable password authentication for the selected host(s) that you want to print from in this manner. This is where the 'hidden' database property "TrustedHosts" comes in. Trusted hosts are allowed to connect to the CUPS server on SME Server without authentication. You trust these hosts to require logins and to have well-behaved users that use the lp command to submit print jobs, so that you'll at least know who the foreign printer users are.

With your local Linux host added to the TrustedHosts database property on the SME Server all that remains to be done is to ensure that the cupsd.conf for your local CUPS server contains the line "Browsing On" (or at least does not contain the line "Browsing Off" since "Browsing On" is the default). The CUPS server on your SME Server sends browse packets to all TrustedHosts. CUPS servers that receive browse packets will automatically add the remote printer queues to their list of available printers. No local configuration is required.

Printing from Linux through a local LPR spooler or standalone lpd client

CUPS provides the cups-lpd daemon for serving lpd clients. There is usually no need to enable this service, but in the rare case that your site does require it, here's how.


This document is Copyright 2003-2006 by Robert van den Aker. It may be freely redistributed in its entirety provided that this copyright notice is not removed.