CUPS

Introduction
CUPS - Common Unix Printing System is a modular printing system for Unix-like computer operating systems that allows a computer to act as a print server. A computer running CUPS is a host that can accept print jobs from client computers, process them, and send them to the appropriate printer.

CUPS consists of a print spooler and scheduler, a filter system that converts the print data to a format that the printer will understand, and a backend system that sends this data to the print device. CUPS uses the Internet Printing Protocol (IPP) as the basis for managing print jobs and queues. It also provides the traditional command line interfaces for the System V and Berkeley print systems, along with limited support for the server message block (SMB) protocol. The device drivers CUPS supplies can be configured by using text files in Adobe's PostScript Printer Description (PPD) format. There are a number of user interfaces for different platforms that can configure CUPS, and it has a built-in web-based interface. CUPS is free software, provided under the GNU General Public License and GNU Lesser General Public License, Version 2.

USE Flags

 * - Install the CUPS Web Administration Desktop File.
 * - Enable Access Control List support.
 * - Enable Avahi/Zeronconf support.
 * - Enable D-BUS support.
 * - Adds support for PAM.
 * - Adds support for (TLS 1.0 and SSL 3.0).
 * - Enable JPEG support in.
 * - Enable PNG support in.
 * - Enable TIFF support in.
 * - Enable support for Samba.
 * - Enable support for automatically generated ppd (printing driver) files.
 * - Enable support for the xinetd super-server.
 * - Support for DNS Service Discovery.
 * - Adds support for Java.
 * - Adds kerberos support.
 * - Adds LDAP support (Lightweight Directory Access Protocol).
 * - Adds support/bindings for the Perl language.
 * - Include support for the PHP language.
 * - Adds support/bindings for the Python language.
 * - Adds Service Locator Protocol support
 * - Adds OpenSSL support.
 * - Adds USB support independent of usblp. Note: Conflicts with usblp module, make sure module is not loaded if USE flag is set.

Configuration
You do not need to change the CUPS configuration files - just using the web interface should be enough.

First, you should add the init script to the default runlevel:

Then start CUPS:

Then just navigate with a web browser to http://localhost:631 (631 is the default port for cupsd).

Local Printer
Finally the section you have waited for.

Just go to http://localhost:631 with your browser and go to the Administration (https://localhost:631/admin/) section.

If your printer is USB and you're a little lucky, CUPS will auto-magically see the printer and offer you a link to add it. Follow the prompts (you should just have to name it) and you should have a working printer. Make sure that if you are using a USB printer that you have USB Printer support enabled in your kernel or it will not show up or be unavailable. If you're asked for a Model/Driver or Model/Manufacturer and your printer isn't listed then you can check if your printer is listed on http://www.linuxprinting.org and try emerging or. After a restart of CUPS you should be able to add your printer without providing a ppd file.

Otherwise, you can manually add it.


 * Name
 * Device
 * Make
 * Model

About Device: If your printer is connected to an LPT port then make sure that you have parallel port support and parallel printer support enabled in the kernel. You may compile them as modules or build them into the kernel. The module names are parport and lp. You'll also want to enable IEEE 1284 transfer modes in the kernel.

If you are using a USB->Parallel adapter, you'll want to do the following:
 * Add your printer by selecting a different connection type (since usb and parallel will not be listed)
 * Edit the file
 * Change the DeviceID line to read:
 * ...actually, it looks like the proper line is now:

Network Printer
Adding a network printer available on a remote CUPS server is fairly straight forward. When adding a printer to CUPS, it defaults to allowing access to it remotely. The only requirement is a valid userid & password.

Point your browser to CUPS on the print server http://printserver:631 and click on the Printers links to see what printers are available. Then click on the printer you want to add to your local workstation. This will give you the URL you'll need for your local CUPS. The url format is server:port/printers/printer_name. Something like http://printserver:631/printers/HP_psc_1310_series_USB_MY4261D0ZPO2_HPLIP

On your local CUPS (http://localhost:631):
 * Add a Printer
 * Name it
 * Device
 * Select Internet Printing Protocol (http)
 * Device URI
 * Plug in the URL you snagged from the print server. e.g. http://printserver:631/printers/HP_psc_1310_series_USB_MY4261D0ZPO2_HPLIP
 * Select the Make
 * Select the Model

HP Printers
Hewlett-Packard users are lucky to have such a vendor as HP provides its own software and driver bundle for their printers/scanners. The package is called, and is already in portage. There are some specific USE flags that should be mentioned:


 * : D-Bus is a free software project which offers a simple way for applications to communicate with one another.
 * : Adds support for automatically generated ppd (printing driver) files
 * : Adds support for the Qt GUI/Application Toolkit version 4.x. You'll probably want to enable this.
 * : Adds support for a scanner.
 * : SNMP exposes management data in the form of variables on the managed systems, which describe the system configuration. These variables can then be queried (and sometimes set) by managing applications.
 * : Adds fax support.
 * : Enable parallel port support for devices which require it. If your printer still uses a parallel port then you'll want to set this flag.

Set the flags you need and then just emerge it:

If your printer uses USB be sure to add your user to the LP group:

Now all you need to do is run the auto-configuration tool:

If the setup program crashes a possible fix is to try and emerge with the  USE flag. If this doesn't help then you may wish to try installing an unstable version of Python. If you want to use hp-toolbox or any other GUI tool from this package you need to install the package.

Foomatic
Portage has some packages called foomatic that contain Postscript files. Postscript files allows your computer to communicate with your printer properly. If you can't print, try installing the proper foomatic packages.

Here is a list of foomatic packages portage has in its repository at the time of this writing: Printer information files for foomatic-db-engine to generate ppds. Generates ppds out of xml foomatic printer description files. linuxprinting.org PPD files for postscript printers. Foomatic wrapper scripts. linuxprinting.org PPD files for non-postscript printers.

Debugging
Error messages here:

Debug level can be switched by

Common Problems
crw-rw-r-- 1 root lp 180, 0 Sep 25 2011 lp0 if different change the ownership with chown/chgrp command.
 * Many HP Printers are reported having problems printing Postscript Level 3. Problems such as rectangle glyphs replacing chars will occur.  When you configure your HP printer, or to resolve this issue, edit the printer's PPD file and set '*LanguageLevel: "2"' instead of "3".
 * If cups cannot find your usb printer check the ownership of /dev/usb/lp0 it must be: