A basic view of the CUPS printing system.
- Software Installation
- Adding a Printer
- Printer Status
- Print to a PDF
- Alternative Configuration Methods and Utilities
- CUPS as Print Server for Windows Machines
- CUPS and Samba
- Printer sharing using Macintosh as the client and Debian as the server
- Printing Pictures
- Other printing Systems
- External links
- See also
The Debian installer presents a print server task for installation when additional software is offered as an option. This will bring in many of the printing-related packages Debian has available. The resulting system will be as complete as it can be and users setting up a print queue (remote or local) will have sufficient Debian printing resources at their disposal to do so. It takes but minutes to install a print queue with lpadmin or the web interface of CUPS and, after that, successful printing is usually ensured if the printer is supported by one of the installed packages.
If you passed up the opportunity to have a print server installed via the installer you can get exactly the same set of packages, after booting into the new system, with
apt-get install task-print-server
Otherwise, a basic but functional set of packages will be obtained with
apt-get install cups
All-in-all, installing the task package is probably a good move if you have little motivation for sorting out which printer driver is suitable for a particular printer after installing the cups package. printer-driver-gutenprint is a package recommended by cups and would normally be installed. It provides a wide selection of good quality drivers but it may be desirable to install additionally one or more of the following:
For a printer which requires a non-free driver you will have to see what the manufacturer has to offer.
Adding a Printer
CUPS has a web interface for setting up a print queue and administering printers. Use your favourite browser (firefox, chromium, lynx, elinks etc) to display the interface and add a printer via the Administration screen. If you are asked for a username and password, see here.
Adding a USB printer is a common occurance and one should automatically be detected as a local printer and a URI for its connection displayed on the next page. With a driver on the system the remainder of its setup should proceed successfully.
A discovered network printer/print queue should be capable of being added just as easily as a USB printer. Its connection will be worked out for you. If the connection begins with dnssd://... you should not install any PPD at a later stage; your server should be sending a job unprocessed to the server.
If you are using the Other Network Printers section you will have to specify a destination for the jobs. Should you find this perplexing consider using the AppSocket URI.
For a full picture of whether the scheduler is running, what the system default destination is, whether a queue is accepting jobs and what is yet to be printed you can do
Print to a PDF
The primary purpose of a printing system is to put toner or ink on a medium and have an output which is professional looking and suitable for the user's needs. However, the files produced at various stages of the filtering process can also be of interest and use to a user. For example, there was time when converting a file to a PDF from an application was not the most straightforward of tasks. A solution was to use cups-pdf as a virtual PDF printer in the application's print dialog. The output PDF is not sent to a real printer but stored on disk. Since then many applications have acquired Print to PDF and Export to PDF options in their dialogs and the situation has improved.
cups-pdf is a backend filter which takes a PostScript file and converts it to a PDF with Ghostscript. It works in conjunction with the CUPS filtering system, which becomes responsible for producing the needed PostScript using /etc/cups/ppd/PDF.ppd and passing it to the backend. The package containing the backend and the PPD is installed with
apt-get install printer-driver-cups-pdf
The installation sets up a print queue with the name PDF. The queue will appear as a printer in an application's print dialog and in the output of lpstat -t. Printing from the command line is done with
lp -d PDF <file_to_be_converted>
The PDF file produced is stored in a user's home directory in the PDF directory, created after the first ever job is sent.
A PDF may or may not be searchable or capable of having text copied from it. PDFs produced from PostScript files submitted to a queue generally do have these features; PDFs from text files do not because they are first filtered by texttopdf.
Alternative Configuration Methods and Utilities
system-config-printer is a printer administration tool which first appeared in Fedora and later in Debian and Ubuntu. The purpose of the tool is to configure a CUPS server (often the local machine) using the CUPS API. The tool is written in Python, using pygtk for the graphical parts and with some Python bindings (pycups) for the CUPS API. It is largely the same as using the CUPS web interface for configuring printers but is a native application rather than a web page.
Specifically for HP printers, hp-setup is included with the HP Linux Imaging and Printing project package, hplip. It performs setup of USB, parallel, network printers and all-in-ones. Network printers are automatically detected via mDNS (aka Bonjour on Macs). Using hp-setup to install a printer also enables hp utilities for checking ink/toner level and printer maintenance. Run hp-check -r to troubleshoot printing or scanning issues.
lpadmin is the fundamental way to set up a print queue and is depended on by the CUPS web interface, system-config-printer and hp-setup. Command line only but very useful if you know exactly what the printer destination is and what driver to use.
CUPS as Print Server for Windows Machines
You can setup CUPS to allow Windows machines to print to a CUPS server using an http address.
First, install the samba package. When you are asked to use WINS, say yes.
$ apt-get install samba
Next setup your /etc/cups/cupsd.conf file.
# Our private connection we listen to Listen *:49631 # Allow machines on local network to use printers <Location /printers> Order allow,deny Allow 192.168.0.* Allow 192.168.1.* </Location>
This will listen on port 49631 from any network. You may use some other port number besides 631. Note that the dynamic and/or private ports as specified by the IANA are in the range 49152 through 65535. Also, this will only allow computers from the local network to print to the CUPS printers.
Next, restart the CUPS daemon
# service cups restart
Now on each Windows machine, Choose that you want to install a network printer and that you want to install a printer on the Internet or home/office network. The URL you will use should be:
Lastly, the driver to install is in the Generic section labeled MS Publisher Color Printer.
CUPS and Samba
This section needs updating as you can setup print server via samba print sharing just by uploading drivers.
When printing to windows printers in an NT domain using SMB the Device URI should read
This allows Samba to authenticate against a domain controller for acces to the printer queue.
You may also omit the username:password@ part when the server does not need authentification. As the hostname both, a windows computer name or an IP address would work. To determine the printername you may use the smbclient command line tool. Run the following command, where computername refers to the name of the machine that shares the printer:
smbclient -L computername
Check the ouput for entries with Type "Printer":
$ smbclient -L base Sharename Type Comment --------- ---- ------- print$ Disk Druckertreiber HPOffice Printer HP Officejet J4500 Series ADMIN$ Disk Remoteadmin C$ Disk Standardfreigabe
The resulting URL from the output above would be
When printing to a Debian CUPS printer from a machine that connects through Samba, you may need to set up a CUPS class to get things to work.
Printer sharing using Macintosh as the client and Debian as the server
You have a printer on a debian machine and you want to share it with a Macintosh, so that the Mac can print to the Debian-based printer. Try this:
1. Use cups to set up the printer on Debian as described above. The Gnome tool for printer configuration works well, and the 100% bullet-proof way is to use the browser-based CUPS configuration.
2. On the Mac (OS X 10.4+) start Print and Fax from System Preferences. Use the + button to add a printer.
3. Look first in the "Default" tab. If the automagic printer-sharing has worked, and your Mac is connected to the local network properly, then the Debian-based printer should already be visible in the list. Just select it and use the recommended print driver. Your results may vary but you can't go to far wrong if you pick a driver that matches the one you are using on Debian. So, for example, you might like to try using Gutenprint drivers at both ends.
4. If your printer is not visible in the Default tab, then try adding it on the "IP" tab. Pick IPP as the protocol, give the plain IP address of the server in the address box, and in the Queue box put "printers/<debian-queue-name>". Put whatever helps you identify the printer in the Name and Location boxes, and choose a printer driver than matches what you used to set up the printer on Debian. Finally cross your fingers, hold your breath, recite a prayer/spell/incantation, and press the Add button.
As they say: your mileage may vary.
Professional looking photos may be obtained when using high quality glossy photo paper on an inkjet printer but care must be taken when submitting the print job. Printing from The Gimp image manipulation program produces very good results. The print dialog will vary depending upon the printer used. The most important settings are type of paper, glossy photo or whatever sort you are using, and image type, "photograph". The size of the printed image is adjusted in the printer dialog as well.
Other printing Systems
Debian has several alternatives available for printing:
CUPS. (Instructions above.) The newer Common UNIX Printing System (or CUPS) is a printing system and general replacement for lpd and the like. It supports the Internet Printing Protocol (IPP), and has its own filtering driver model for handling various document types.
LPR. The still commonly used traditional printing system is called lpr which works quite well if you have a postscript printer. Otherwise, it is not very simple to set up and doesn't provide much control for users on the printer settings per print job.
RLPR Remote line printer spooling system.
xpp is designed to be able to take the same command-line arguments as BSD-lpr and SysV-lp so most apps won't realize the difference if you create a symbolic link from /usr/bin/lpr (or /usr/bin/lp) to /usr/bin/xpp. This way, whenever an application sends off a print job to the lpr (or lp) program, xpp will launch its GUI so that you can select the options that you would like for this job.
These alternatives are maintained by different groups. But there is a lot of collaboration and coordination between them, which occurs on the debian-printing list.
system-config-printer - GTK+ graphical user interface to configure a CUPS server