1. Trang chủ
  2. » Công Nghệ Thông Tin

Common UNIX Printing System Sweet phần 2 pdf

63 278 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 63
Dung lượng 5,32 MB

Nội dung

< previous page page_36 next page > Page 36 This page intentionally left blank. < previous page page_36 next page > < previous page page_37 next page > Page 37 CHAPTER 3 Setting Up Printers and Classes < previous page page_37 next page > < previous page page_38 next page > Page 38 This chapter describes how to set up and manage printers and classes on your system from the command- line and Web interfaces. Basics of Printers Each printer queue has a name associated with it; the printer name must start with a letter and can contain up to 127 letters, numbers, and the underscore (_). Case is not significant, so ''PRINTER","Printer", and "printer" are all considered the same name. Printer Devices Printer queues have a device associated with them. The device can be a parallel port, a network interface, or any other interface that is supported by a backend. Devices within CUPS use uniform resource identifiers ("URIs") which are a more general form of the uniform resource locators ("URLs") that are used in your Web browser. For example, the first parallel port in Linux usually uses a device URI of parallel:/ dev/lp0. Getting a List of Available Devices You can see a complete list of supported devices by running the lpinfo command: lpinfo -v ENTER file file network socket network http network ipp network lpd direct parallel:/dev/lp0 serial serial:/dev/ttyS0?baud=115200 serial serial:/dev/ttyS1?baud=115200 direct usb:/dev/usb/lp0 network smb The -v option specifies that you want a list of available devices. The first word in each line is the type of device (direct, file, network, or serial) and is followed by the device URI or scheme name for that device. File devices have device URIs of the form file:/directory/filename whereas network devices use the more familiar scheme://server or scheme://server/path format. Some backends support options, which are added to the end of the URI starting with a question mark. In the preceding list of devices, the ?baud=115200 option on the serial port URIs specifies the maximum baud rate supported by that port. Other options can be specified such as parity checking, data bits, and flow control. < previous page page_38 next page > < previous page page_39 next page > Page 39 File Devices The file device allows you to configure a printer to print to a file for testing, or to blindly send print files to a device or named pipe. The absolute path of the file is appended to the file: scheme name to form the device URI: file:/foo/bar/filename.prn The file device does not support any options. NOTE: The file device is currently implemented as an internal device within CUPS. This prevents you from printing raw print files to the printer because no filter is in place to actually copy the print job to the file. Also, the file device overwrites normal files. Because the scheduler normally runs as root, you should be careful not to configure a printer that points to an important file like /etc/passwd! HTTP and IPP Devices The HTTP and IPP devices allow you to send print jobs to a printer or server that supports IPP. The HTTP device handles URIs with a scheme name of ''http:" whereas the IPP device handles URIs with a scheme name of "ipp:." These devices do not support any options in the device URI, but print job options are passed to the remote device with little or no change. You can embed the username and password in the device URI if the remote device requires them: http://username:password@server/path ipp://username:password@server/path A CUPS server supports printers using the following URIs http://server/printers/ name http://server:port/printers/ name ipp://server/printers/ name ipp://server:port/ printers/ name where name is the name of the printer. Similarly, classes use the following URIs: http://server/classes/ name http://server:port/classes/ name ipp://server/classes/ name ipp://server:port/ classes/ name Printers with network interfaces and external network print servers use different URIs. Table 3.1 summarizes the common URIs: < previous page page_39 next page > < previous page page_40 next page > Page 40 TABLE 3.1 Common URIs for Network Printers and Print Servers Manufaturer URI Axis ipp://server/LPT1 (Parallel 1) ipp://server/LPT2 (Parallel 2) ipp://server/COM1 (Serial 1) HP ipp://server/ipp (Internal) ipp://server/ipp/port1 (Parallel 1) ipp://server/ipp/port2 (Parallel 2) ipp://server/ipp/port3 (Parallel 3) Microsoft ipp://server/printers/name Tektronix ipp://server/ipp Xerox ipp://server/ipp With the Microsoft Windows 2000 IPP server, the name in the URI is the share name of the printer. Consult the documentation that came with your printer or print server if you don't see your manufacturer listed in Table 3.1. LPD Devices The LPD device supports the legacy line printer daemon protocol, which is described in RFC 1179. Microsoft implements this protocol in the TCP/IP Printing Service. The URI used by the LPD device is lpd://server/ name where name is the name of the remote printer queue. The queue name for printers on a Windows NT server will be the share name for the printer. For network interfaces and print servers consult Table 3.2. TABLE 3.2 Common URIs for LPD Printers and Print Servers Manufacturer URI Apple lpd://server/PASSTHRU Axis lpd://server/LPT1 (Parallel 1) lpd://server/LPT2 (Parallel 2) lpd://server/COM1 (Serial 1) Castelle lpd://server/pr1 (Parallel 1) lpd://server/pr2 (Parallel 2) lpd://server/pr3 (Parallel 3) < previous page page_40 next page > < previous page page_41 next page > Page 41 DPI lpd://server/pr1 (Parallel 1) lpd://server/pr2 (Parallel 2) lpd://server/pr3 (Parallel 3) EFI lpd://server/print Extended System lpd://server/pr1 (Parallel 1) lpd://server/pr2 (Parallel 2) lpd://server/pr3 (Parallel 3) Hewlett Packard lpd://server/raw (Internal) lpd://server/raw1 (Parallel 1) lpd://server/raw2 (Parallel 2) lpd://server/raw3 (Parallel 3) Intel lpd://server/LPT1_PASSTHRU (Parallel 1) lpd://server/LPT2_PASSTHRU (Parallel 2) lpd://server/COM1_PASSTHRU (Serial 1) Lexmark lpd://server/ps Linksys lpd://server/P1 (Parallel 1) lpd://server/P2 (Parallel 2) lpd://server/P3 (Parallel 3) Kodak lpd://server/ps QMS lpd://server/ps Xerox lpd://server/PORT1 lpd://server/PASSTHRU The LPD device also supports several options, which are shown in Table 3.3. TABLE 3.3 LPD Device Options Option Description banner=no Tells the remote printer not to print a banner page (default) banner=yes Tells the remote printer to print a banner page format=c Tells the remote printer that the print file is in CalTech intermediate format (CIF) format=d Tells the remote printer that the print file is in TeX dvi format format=f Tells the remote printer that the print file is a text file format=g Tells the remote printer that the print file is a Berkeley plot file format=l Tells the remote printer that the print file is already formatted for the printer (default) < previous page page_41 next page > < previous page page_42 next page > Page 42 format=n Tells the remote printer that the print file contains the output from the ditroff command format=o Tells the remote printer that the print file is a PostScript file format=p Tells the remote printer that the print file is a text file that should be pretty- printed as with the pr command format=r Tells the remote printer that the print file is output from a FORTRAN program format=t Tells the remote printer that the print file is output from the troff program format=v Tells the remote printer that the print file is a Sun raster format file order=control,dataSends the control file to the remote printer first order=data,controlSends the data file to the remote printer first (default) Most LPD printers will only need the basic URI: lpd://server/name If print jobs go to the printer but do not print, the banner and order options may correct the situation: lpd://server/name?banner=yes lpd://server/name?order=control,data lpd://server/name?banner=yes +order=control,data The output format is normally ignored by most network printers and print servers. Parallel Devices The parallel devices support the standard parallel printer ports on the system. The device URI consists of the scheme name followed by the device filename; the following are used in various versions of Linux to refer to the first parallel port: parallel:/dev/lp0 parallel:/dev/par0 parallel:/dev/parallel/0 Use the lpinfo command described earlier to determine which device filename to use on your system. The parallel device does not support any options. Serial Devices The serial devices support the standard RS-232C serial ports on the system. The device URI consists of the scheme name followed by the device filename and any options; the following are used in various versions of Linux to refer to the first serial port: < previous page page_42 next page > < previous page page_43 next page > Page 43 serial:/dev/ttyS0 serial:/dev/serial/0 The serial backend supports several options, which are listed in Table 3.4: TABLE 3.4 Serial Device Options Option Description baud=N Sets the speed of the serial port in bits per second (baud). The default value is usually 9,600 baud. The maximum value is reported by the lpinfo command. bits=7 Sets the number of data bits in each character to 7. bits=8 Sets the number of data bits in each character to 8 (default). flow=rtscts Sets the flow control to use the request-to-send (RTS) and clear-to-send (CTS) signal lines. flow=dtrdsr Sets the flow control to use the data-terminal-ready (DTR) and data-set-ready (DSR) signal lines. flow=hard Sets the flow control to use the request-to-send (RTS) and clear-to-send (CTS) signal lines. flow=none Disables flow control completely (default). flow=soft Uses the XON and XOFF characters to do flow control; this method is usually not very reliable with printers. parity=evenSends a parity check bit with every character; the result of the sum of all bits must be even. parity=noneDoes not send a parity check bit (default). parity=odd Sends a parity check bit with every character; the result of the sum of all bits must be odd. A serial printer on port 1 operating at 19200 baud with 7 data bits, even parity, and DTE-DSR flow control would need the following device URI: serial://dev/ttyS0?baud=19200+bits=7+parity=even+flow=dtedsr Because the serial port is so slow compared to other interfaces, it is generally only used as a last resort or for printing text to dot-matrix printers. SMB Devices The SMB device supports printing to Windows printers using the SMB protocol and is provided with the SAMBA software. The device URI for a SMB printer looks like smb:// workgroup /server/ name < previous page page_43 next page > < previous page page_44 next page > Page 44 where workgroup is the name of the workgroup that the server belongs to, server is the NetBIOS name of the server, and name is the share name of the printer. For a printer named ''bar" on server "foo" in workgroup "ESP," the URI would be: smb://ESP/foo/bar If the shared printer requires a username and password, which is usually the case for printers shared from a Windows NT or 2000 server, they can be provided in the URI: smb://username:password@workgroup/server/name NOTE: Because of the potential security issues that come with including usernames and passwords in the URI, you may want to use the TCP/IP Printing Services supplied with Windows NT or the IPP Printing Services supplied with Windows 2000 instead. These services have the added benefit of associating the correct username with the print job, because the smb backend can only send the username you provide in the URI. Socket Devices The socket device supports direct printing by using TCP/IP sockets, often called AppSocket printing or the JetDirect protocol. The device URI only needs the server name and optionally a port number: socket://server socket://server:port The default port number is 9100, which is used by all HP JetDirect interfaces and many other network printers. Table 3.5 shows the port numbers to use with various equipment: TABLE 3.5 URIs for Socket Devices Manufacturer URI Axis socket://server:9100 (Parallel 1) socket://server:9101 (Parallel 2) socket://server:9102 (Parallel 3) EPSON socket://server Hewlett Packard socket://server (Internal) socket://server:9100 (Parallel 1) socket://server:9101 (Parallel 2) socket://server:9102 (Parallel 3) Lexmark socket://server:5503 < previous page page_44 next page > < previous page page_45 next page > Page 45 Linksys socket://server:4010 (Parallel 1) socket://server:4020 (Parallel 2) socket://server:4030 (Parallel 3) NETGEAR socket://server:4010 (Parallel 1) socket://server:4020 (Parallel 2) socket://server:4030 (Parallel 3) Tektronix socket://server XEROX socket://server:5503 The socket device is often the best performing and most reliable supported by a network printer or server. The socket device can also stream print data to the printer, whereas other network devices need to store the print data in a temporary file before it can be sent to the printer. USB Devices The USB devices support printing over the universal serial bus (USB). USB support is currently available for Linux and the PC BSD operating systems. The device URIs for USB printers vary widely, even among Linux distributions, for example usb:/dev/ulpt N usb:/dev/ulpt N usb:/dev/usblp N usb:/dev/usb/lp N usb:/dev/usb/usblp N Where N is the USB printer number starting at 0. Like the parallel devices, the USB devices do not support any options. NOTE: USB printer numbers are assigned dynamically at boot time and as printers are connected and disconnected. This can cause an existing printer to become associated with the wrong device. CUPS 1.2 contains a device monitoring daemon that updates the printer device URI as new USB printers are connected and disconnected, and at boot time. Printer Drivers Printer queues also usually have a PostScript printer description (PPD) file associated with them. PPD files describe the capabilities of each printer, the page sizes supported, and so forth. CUPS uses PPD files for both PostScript and non-PostScript printers. < previous page page_45 next page > [...]... Hewlett-Packard DeskJet printers except the Deskjet 710, 7 12, 720 , 722 , 820 , and 1000 epson9.ppd All EPSON 9-pin dot-matrix printers and compatibles epson24.ppdAll EPSON 24 -pin dot-matrix printers and compatibles laserjet.ppd All Hewlett-Packard LaserJet printers except the LaserJet 3100 and 3150 okidata9.ppdAll Okidata 9-pin dot-matrix printers okidat24.ppdAll Okidata 24 -pin dot-matrix printers stcolor.ppd All EPSON... Supported resolutions EPSON 9-pin Series letter, legal, a4, fanfoldus 60dpi, 120 dpi ,24 0dpi EPSON 24 -pin Series letter, legal, a4, fanfoldus 60dpi, 120 dpi, 180dpi, 360x180dpi, 360dpi EPSON Stylus Color letter, legal, tabloid, a4, a3 180dpi, 360dpi, 720 dpi EPSON Stylus Photo letter, legal, tabloid, a4, a3 180dpi, 360dpi, 720 dpi HP DeskJet Series letter, legal, tabloid, a4, a3 150dpi, 300dpi, 600dpi HP... CUPS v1.1 epson24.ppd EPSON 24 -Pin Series CUPS v1.1 stcolor.ppd EPSON Stylus Color Series CUPS v1.1 stphoto.ppd EPSON Stylus Photo Series CUPS v1.1 deskjet.ppd HP DeskJet Series CUPS v1.1 laserjet.ppd HP LaserJet Series CUPS v1.1 okidata9.ppd OKIDATA 9-Pin Series CUPS v1.1 okidat24.ppd OKIDATA 24 -Pin Series CUPS v1.1 For an HP DeskJet printer connected to the parallel port on a Linux system the lpadmin... Okidata 9-pin Series letter, legal, a4, fanfoldus 60dpi, 120 dpi, 24 0dpi Okidata 24 -pin Series letter, legal, a4, fanfoldus 60dpi, 120 dpi, 180dpi, 360x180dpi, 360dpi The lpoptions command will list the supported options and values for other drivers: lpoptions -p name -l ENTER Finally, the job-sheets-default option specifies the banner page to use when printing files: lpadmin -p name -o job-sheets-default=standard... page page_47 next page > < previous page page_48 next page > Page 48 Similarly, an HP LaserJet printer using a JetDirect network interface at IP address 11 .22 .33.44 would be added with the command: /usr/sbin/lpadmin -p LaserJet -E -v socket://11 .22 .33.44 -m laserjet.ppd ENTER Configuring Your Printer from the Command-Line After you have added your printer, you should configure the default options for... < previous page Page 52 FIGURE 3.4 Serial configuration page page_ 52 next page > FIGURE 3.5 Manufacturer selection page < previous page page_ 52 next page > < previous page Page 53 FIGURE 3.6 Model selection page page_53 next page > FIGURE 3.7 Print queue status page < previous page page_53 next page > < previous page page_54 next page > Page 54 FIGURE 3.8 Printer options page Printing a Test Page After... printer's PPD file -u allow:all Allows all users to print to the printer -u allow:user1, user2, ,userNAllows the named users to print to the printer -u deny:user1, user2, ,userN Prevents the named users from printing to the printer -v device-uri Sets the device for communicating with the printer If a job is currently printing on the named printer, the job is restarted and sent to the new device -D info Provides... 604,800, and a month is 2, 5 92, 000 seconds For quotas to be enforced, the period and at least one of the limits must be set to a non-zero value The following options will enable quotas lpadmin -p name -o job-quota-period=604800 -o job-k-limit=1 024 ENTER lpadmin -p name -o job-quota-period=604800 -o job-page-limit=100 ENTER lpadmin -p name -o job-quota-period=604800 -o job-k-limit=1 024 -o job-pagelimit=100... the name of the printer The name can be up to 127 characters long as described earlier in this chapter The -E option enables the printer for printing If you do not provide this option then you will not be able to print to the printer The -v option specifies the device URI to use with the printer Use the lpinfo command to find the available devices on your system Finally, the -m option specifies an installed... There is no undo command FIGURE 3.11 Printer deletion confirmation page < previous page page_61 next page > < previous page page_ 62 next page > Page 62 Starting Printers Click the Start Printer button to start a stopped printer Any pending jobs for that printer will begin printing immediately Stopping Printers Click the Stop Printer button to stop a running printer Any active jobs for that printer will . DeskJet printers except the Deskjet 710, 7 12, 720 , 722 , 820 , and 1000 epson9.ppd All EPSON 9-pin dot-matrix printers and compatibles epson24.ppdAll EPSON 24 -pin dot-matrix printers and compatibles laserjet.ppd. consult Table 3 .2. TABLE 3 .2 Common URIs for LPD Printers and Print Servers Manufacturer URI Apple lpd://server/PASSTHRU Axis lpd://server/LPT1 (Parallel 1) lpd://server/LPT2 (Parallel 2) lpd://server/COM1. fanfoldus 60dpi, 120 dpi ,24 0dpi EPSON 24 -pin Series letter, legal, a4, fanfoldus 60dpi, 120 dpi, 180dpi, 360x180dpi, 360dpi EPSON Stylus Color letter, legal, tabloid, a4, a3 180dpi, 360dpi, 720 dpi EPSON

Ngày đăng: 08/08/2014, 21:21

TỪ KHÓA LIÊN QUAN

w