User Tools

Site Tools


handbook:handbook:print2

CUPS

Introduction

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

CUPS consists of a Unix 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 System V and Berkeley command line interfaces, along with limited support for the server message block protocol (SMB). The device drivers CUPS supplies are based on the PostScript Printer Description (PPD). 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 provided under the GNU General Public License and GNU Lesser General Public License, Version 2.

It provides a mechanism that allows print jobs to be sent to printers in a standard fashion. The data is sent to a scheduler which then sends jobs to a filter system that converts the print job into a format the printer will understand. The filter system then passes the data on to a backend—a special filter that sends print data to a device or network connection. The system makes extensive use of PostScript and rasterization of data in order to convert the data into a language that the printer will understand.

With CUPS, it is far easier for printer manufacturers and printer driver developers to create drivers that work natively on the print server than they were able to previously with other Unix printing systems. As the processing is done on the server, it's also far easier to allow for network based printing than it was previously with other Unix printing systems. One advantage is that when used with Samba, printers can be used on remote Windows computers and in fact generic PostScript drivers can be used to print across the network.

Sheduler

The CUPS scheduler implements Internet Printing Protocol (IPP) printing, which is a printing protocol that utilises the HTTP protocol to manage print jobs and print queues. The scheduler accepts HTTP/1.1 requests, and provides a web-based interface for managing print jobs, the configuration of the server and also for maintaining documentation about CUPS itself.

Filter System

One of CUPS' main advantages is that it can process a variety of data formats on the print server. It converts the print job data into the final language/format of the printer via a series of filters. It does this using Multipart Internet Mail Extensions (MIME) types. MIME is an Internet Standard for the format of e-mail but is commonly used in other systems to determine the type of file that is being processed.

MIME Database

After the print job has been given to the scheduler, it is then passed to the CUPS filter system. This processes the print data and coverts it to a format that the printer will understand. When the CUPS daemon starts, it loads two MIME databases: mime.types and mime.convs. mime.types defines the known file types that CUPS can accept data for, and mime.convs defines the program that processes that particular MIME type.

Filtering Process

The filtering process works by taking input data preformatted with six arguments: the name of the printer queue or print filter, the job ID of the print job, the user-name, the job-name, the number of copies to print, any print options, and the filename (though unnecessary if it is coming from standard input). It then determines the type of data that is being input and the filter to be used through the use of the MIME databases, for instance image data will be detected and processed through a particular filter and HTML data detected and processed through another filter.

Backends

The backends are the ways in which data is sent to the printer. There are several different backends available for CUPS: parallel, serial, and USB ports, as well as network backends that operate via the IPP, JetDirect (AppSocket), Line Printer Daemon (“LPD”) and SMB protocols.

The Process Scheme

Installing CUPS

It can be installed using the package manager of your distribution but also from source. The path of least resistance is to use an OS that comes with CUPS pre-installed or with CUPS packages. If that's not possible, you'll find the CUPS download page at http://www.cups.org/software.html.

Requirements

There are a few requirements to build CUPS from source. You'll need libraries for JPG, PNG, TIFF, and ZLIB. Technically, you can build CUPS without them, but you'll be giving up some functionality. If you don't have them already, the CUPS folks have provided a handy mirror of the necessary libraries at ftp://ftp.easysw.com/pub/libraries

CUPS Config

The configuration of CUPS is globaly handeled by the file /etc/cups/cupsd.conf

Actually it's no magic to configure it since every step and part of the config is explained.

CheapFlights To Nassau

handbook/handbook/print2.txt · Last modified: 2010/04/15 21:18 (external edit)