Configuration and use of printers under Linux

Source: Internet
Author: User

1, the composition of the printer:
The printer has its own CPU, memory, operating system and even hard disk, if it is a network printer, then it should also run its own Web server, users can access their Web site for configuration and management.
2 Printer's language:
The printer describes the page to be printed using the page description language (Description language,pdl).
A PDL-encoded page can provide a smaller amount of data than the original image and a larger transmission speed. Also, PDL can implement page descriptions that are independent of device and resolution.
Mainstream pdl:postscript, PCL5, PCL6, PDF.
PostScript is the most common PDL on Linux, and almost all page layout programs can generate PostScript.
3, the working process of the printer:
When the user presses the Print button in the application, a print job is sent to the printer. When the printer receives a job described in PDL, it calls its own raster image processor to convert the file into a bitmap, a process called raster image processing. After the printer receives the bitmap, it can print. Some printers can understand almost all of the mainstream PDL, while others will not understand anything. The latter printer, called GDI printers, relies on the computer to do raster processing and then receives the ready-made bitmap image.
4. Printer driver:
The driver for a printer is not really a "driver" because it does not have much to do with hardware drivers. Turn the file into a PDL that the printer understands, which is all the things the printer driver does.
5. CUPS:
Cups is an abbreviated form of the public Unix Printing system (comon UNIX Printing systems).
Cups is based on the server/client architecture.
Cups uses the HTTP protocol to manage print tasks and opens this management interface by using a browser to access the 631 port of the host. Enter http://localhost:631 in the Address bar and press ENTER.
6, the printer choice:
Before choosing a printer, you should first understand how much of this product can be supported under Linux. The most straightforward approach is to access the www.linuxprinting.org foomatic database, which will print into 4 levels from paperweight to perfectly. There is no doubt that the pefectly class of printers can get the best support under Linux, and users should choose this category as much as possible.
7. How does cups identify the printer?
When a user assigns a print job to cups, cups should be aware of the features that the PDL and printer can provide for the currently connected printer. All of this information is included in the PPD file of the printer. The PPD represents the PostScript Printer Description, which is the PostScript printer description. This document records the parameters and functions of the printer, the cups filter, and the printer drivers on other platforms to determine how to send the print job to a PostScript printer. Today, each PostScript printer is provided with a specific PDD file, which can usually be found on the installation CD.
For cups, non-PostScript printers can also be described using PDD files. As long as you find the PDD file for a printer, cups can drive it, at least in theory.
8. How do I find the PDD file for a specific printer?
Linuxprinting.org provides a large number of such PDD files. All you have to do is download the PDD file for the printer and copy it to the cups directory. Typically, this directory is/usr/share/cups/model (Ubuntu is/USR/SHARE/PPD).
Sometimes a PPD file is found that is a generic PPD file for a certain type of printer, and therefore does not perform the full functionality of the printer. But at least it's better than nothing.
9. Configure the printer:
Lpoptions-d N7400 #将N7400设置为当前用户的默认打印机.
LPR example.pdf #将example. pdf file Printing.
As long as you simply pass a file name as a parameter to the LPR command, cups prints the file using the default printer. If you have more than one printer connected, you can use the-P option to specify which printer to use to print the document. For example, the following command explicitly specifies that the file example.pdf be printed using N7400.
Lpr-p N7400 Example.pdf
10. Cups configuration file:
Cups's configuration file is called cupsd.conf, and is usually stored in the/etc/cups directory. This is a text file that you can use to view its contents using the more or less commands.
Less/etc/cups/cupsd.conf
In this file, Listen localhost:631 indicates that cups is serving on port 631.
Cups can provide services to other hosts on the network, and for cups to accept print jobs from other hosts, the following lines should be found in cupsd.conf:
<location/>
Order Allow,deny
</Location>
Replace them with the following form. Where netaddress should be replaced with the IP address of the network.
<location/>
Order Allow,deny
Deny from all
Allow from 127.0.0.1
Allow from netaddress
</Location>
The meaning of these lines: Deny from all means that cups does not accept print requests from any host. Two exceptions are defined in the following lines: Allow from 127.0.0.1 and enable from netaddress allows the printing service to be used by computers from both native (127.0.0.1) and netaddress.
In order for hosts on your network to see the print service that the cups server is providing, you should also find this line:
Browseaddress @LOCAL
Modify it to:
Browseaddress broadcastaddress:631
Where broadcastaddress should be replaced with the broadcast address of the network (for example, 10.71.84.255). All 0 and 1 of the host address chant is reserved as network address and broadcast address.
After saving the configuration file, restart the cups server for the changes to take effect:
sudo/etc/init.d/cups restart
11. Set the printer class:
To add a printer class, you can use the Lpadmin command, the following two commands to create the printer class office, and add the printer N7400 and Zoe to this class.
Lpadmin-p N7400-C Office
Lpadmin-p ZOE-C Office
To remove a printer from the class, use the-r option:
Lpadmin-p Zoe-r Office
Delete classes and printers using the-X option:
Lpadmin-x Zoe #删除打印机zoe
Lpadmin-x Office #删除打印机类office
12. Printer queue:
LPQ can query the status information of the current print job from the cups server.
The 3rd column in LPQ reports the job number. To delete a print job, you can use the LPRM command to provide the job number as a parameter.
For example: LPRM 5 #删除作业号为5的打印作业.
13, the status of the printer:
You can use the LPSTAT-T command to display status information for the current cups.

Configuration and use of printers under Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.