Printing the CUPS

On a multitasking and multiuser system such as Linux, a better way to print is to spool the data and schedule the printing: send the output to a file, and have a separate process send the output to the printer. That way, you can continue with your work while the printing insider insight takes place in the background. In addition, if your system has more than one user, everyone can print on the same printer, without worrying about whether or not the printer is available; the background printing process can take care of all the details.

That's how the CUPS printing environment works. Users use a client program — lp or lpr—to send the files to be printed to a server called cupsd, the printer daemon, over a TCP/IP connection. The cupsd server then queues the files, filters the files (to get them ready for the printer), and sends them to the printer.

Although you typically have only one printer connected to your PC, one advantage of the CUPS printing system is the capability to print on a printer connected to another system on a network. Printing to a remote printer is handled in the same fashion as printing to a local printer; the local cupsd daemon simply sends the files to the remote system's server.

As explained earlier, the user-level programs for spooling a file are lp and lpr. When lp or lpr runs, it sends the data to the cupsd server that manages the specified print queue. Other user-level commands for working with print queues are Ipstat, Ipq, cancel, Iprm, and Ipc. The program that completes the CUPS printing environment is the CUPS scheduler: cupsd.

In addition to the commands Ipd, lpr, Ipq, Iprm, cancel, and Ipc, the configuration files in the /etc/cups directory play a crucial role in the CUPS printing environment. The section "Understanding the CUPS Configuration Files" describes the key configuration files.

A good way to understand CUPS is to take a look at the CUPS architecture — the parts that make up CUPS and how they fit together. CUPS is designed around the cupsd print scheduling process that accepts print jobs submitted through printing commands, spools print files, uses filters to convert files to a form acceptable to the printer, and sends the data to printers using backends. Figure 4-8 shows the basic architecture of CUPS.

Configuration Files

• /etc/cups/printers.conf

• /etc/cups/mime.convs /etc/cups/ppd-PPD files

Remote Printers

CUPS Backend in Local Printers

/usr/lib/cups/backend directory

/var/spool/cups

Spool Directory

Figure 4-8: The CUPS Architecture.

Remote Printers

CUPS Backend in Local Printers

/usr/lib/cups/backend directory

/var/spool/cups

Spool Directory

Figure 4-8: The CUPS Architecture.

As Figure 4-8 shows, the major components of CUPS are as follows:

1. CUPS Scheduler: cupsd is the scheduling process that acts as an HTTP 1.1 server and handles printing requests sent by clients using the Internet Printing Protocol (IPP). cupsd also acts as a Web server and provides a Web interface for administering CUPS print queues.

2. Configuration Files: The configuration files in /etc/cups directory control how CUPS works. The "Understanding the CUPS Configuration Files" section further describes these files.

3. Printing Commands: System V and BSD printing commands enable you to submit print jobs and check printer status from the command line.

4. Filters: The filter programs located in the /usr/lib/cups/filter directory convert various input file formats (such as text, PostScript, and image) into output understood by the printer on which the file is being printed. CUPS uses Ghostscript to convert PostScript page description language into output suitable for a specific printer.

5. Backend: The backend programs located in the /usr/lib/cups/backend directory send the output of the filters to the destination printer. Each backend takes care of sending output to a specific type of connection such as a locally connected parallel printer or a remote Windows printer that communicates with the SMB protocol.

Was this article helpful?

0 0
Make Money Writing

Make Money Writing

This Report Will Show You How To Make Money By Providing Writing Services To Other Internet Marketers. Learn how to make money by writing the right way. Grab your copy of this report now and learn. Why writing is a great way to earn money. How to compete with cheap writers, even if you charge a lot more money.

Get My Free Ebook


Post a comment