2.5. Configuring Printing
In order to print from your Fedora system, you have to configure at least one print queue to manage documents waiting to be printed. For printers directly connected to your computer, this process is fully automatic, and for other printers (such as those on your network), it is very simple.
2.5.1. How Do I Do That?
Select the menu option SystemAdministrationPrinting (in KDE, it is AdministrationPrinting). You will be prompted to enter the root password, and then the printer configuration window will appear, as shown in Figure 2-16. If any print queues have been previously defined, they will be listed on the left side of the window, grouped according to connection type; if you click on one of these printers, the configuration details for that printer will appear on the right.
Figure 2-16. Printer configuration window
18.104.22.168. Add a new print queue
USB and parallel printers, as well as network printers that use the Internet Print Protocol (IPP), will be detected and configured automatically; you can adjust the printer configuration by editing the values in the main printer-configuration window (Figure 2-16) and then clicking Apply.
Other printers must be configured manually. Click on the New Printer icon to access the window shown in Figure 2-17.
Figure 2-17. New Printer window
Enter the name of the printer, which should be short and contain no spaces. I recommend using the generic printer type followed by a number (e.g., laser3 or inkjet0); even if you only have one printer now, you may add more in the future. If desired, you can add verbose description and location information. Click Forward to proceed to the connection configuration step, shown in Figure 2-18.
Figure 2-18. Printer connection configuration
The Devices list shows all detected local printers, plus serial ports and common network printing protocols. Select the appropriate option; for network printers, you will need to enter the IP address or hostname as well as the printer or queue name. Press Forward to proceed to the driver configuration step, shown in the left side of Figure 2-19. Select the printer manufacturer, then click Forward; on the next display (shown on the right side of Figure 2-19), select the printer model. Use the Comments buttons to display information about the printer, driver, or PPD file.
The Drivers list may present more than one driver option. In almost all cases, it is best to use the default driver.
Figure 2-19. Printer driver selection
22.214.171.124. Edit an existing print queue
To change an existing queue configuration, select the printer in the main window (Figure 2-16) and edit the option values on the tabs:
126.96.36.199. Set the default print queue
The command lpr (line printer requester) is used to place a print request into a queue. When used from the command line, lpr can accept input from standard input or from a specified file. For example, to print the file output.ps:
$ lpr output.ps
$ cal -y | lpr
To specify a specific print queue (such as laser3), add the -P argument along with the name of the queue:
$ lpr -P laser3 output.ps $ cal -y | lpr -P laser3
You can view the status of a print queue, including the documents in the queue, by clicking on the printer icon that appears in the notification area of the GNOME panel bar. The window shown in Figure 2-20 will appear; this window shows all print requests made by you on all print queues. To delete a document from the queue, right-click on it and select the Cancel document option.
Figure 2-20. Document print-status window
$ lpq inkjet0 is ready no entries
While the graphical Document print-status window shows requests by one user on all queues, lpq shows requests by all users on a single queue. The output in the previous example shows that there are no documents in the default queue inkjet0. You can specify a specific printer queue using the -P argument:
$ lpq -P laser3 laser3 is ready and printing Rank Owner Job File(s) Total Size active chris 91 report.ps 124928 bytes 2 jason 92 spreadsheet.ps 523423 bytes
In this case, there are two jobs in the queue; job 91 is printing, and job 92 is scheduled to be printed next.
You can delete a document using the lprm command, which accepts a job number (the default is the active job) and the -P option to specify the print queue. This command will delete job 92 on the print queue laser3:
$ lprm -P laser3 92
2.5.2. How Does It Work?
Fedora's printing system combines four fairly complex tools into a comprehensive print solution. The Common Unix Printing System (CUPS) provides queue management and printer sharing; the Foomatic system provides access to the large database of printer configuration information and notes maintained by linuxprinting.org; Ghostscript converts PostScript, the most common printer output format used by Linux applications, into other formats for use by non-PostScript printers; and the system-config-printer script provides the user interface for printer configuration.
system-config-printer manipulates the CUPS configuration files in /etc/cups and restarts the CUPS server ( cupsd) to load configuration changes. These files can be edited by hand, but this is not recommended.
CUPS provides queue management, storing queued documents in /var/spool/cups until they are printed. It is heavily tied into the Internet Print Protocol (IPP), which is based on the web protocol HTTP. You can connect to the CUPS server's administrative interface by accessing the address http://localhost:631/ through a web browser; however, if you do any configuration through that interface, you may no longer be able to use system-config-printer, which is generally a better configuration tool.
Applications vary enormously in the quality of their interface into the print system:
2.5.3. What About...
188.8.131.52. ...creating a group of similar printers that are accessed on a first-available-printer basis?
This is called a printer class; to create one, use the New Class button in the graphical configuration tool. Add the desired printers to the printer class and click Apply; you can then print to the printer class instead of a specific printer, and the first available printer will be used to print your document.
184.108.40.206. ...setting up more than one queue for a printer?
For example, I have a color inkjet printer, which is used in text mode with plain paper and in a photo mode with photo paper. I have created three separate queues: color0-draft for fast, low-quality printing that saves ink; color0 for regular printing; and color0-photo for photo printing. The appropriate driver options have been set for each. Although it is possible to create just one queue and set the resolution and paper type within some applications, not all applications are capable of setting those options, and it's simply faster and more convenient to have preconfigured queues. Similarly, I have single- and double-sided queues for my laser printer.
220.127.116.11. ...making a PDF instead of printing?
Many applications that don't provide PDF output do provide the ability to print to a file instead of printing to an output queue; this feature can be used to save a PostScript copy of the print request, which you can then convert to a PDF by using Ghostscript via the ps2pdf script.
For example, you could "print" from Firefox to the file bankstatement.ps and then convert bankstatement.ps to bankstatement.pdf with this command:
$ ps2pdf bankstatement.ps
The resulting PDF file can be viewed with Evince, xpdf, or Adobe Acrobat Reader (not installed by default).
18.104.22.168. ...using an HP multifunction printer?
HP produces several lines of multifunction printer/copier/scanner devices that use a multiplexed communication protocol; the printer and scanner are accessed through a single connection. The software necessary to access these devices is built into Fedora Core; just ensure that the hplip service is running.
2.5.4. Where Can I Learn More?