Unless you're working with an older mainframe or UNIX
setup, you probably won't ever run into a line printer. Line printer
technology is outdated and not used all that often today. Today's modern
equivalent isn't even a line printer; it's more likely a high-speed
printer configured to provide the equivalent services. It turns out that setting up a line printer is one of the ways you can
share your printer (network or local) with a Linux machine. In fact,
this technology is so embedded that some vendors like Hewlett-Packard
provide print servers to provide Line Printer Daemon (LPD) services.
Windows provides a
special LPD service to provide line printer support. The LPD service is
an older TCP/IP service that you install with the Print Services for
UNIX (found in the Other Network File and Print Services folder in the
Windows Components Wizard dialog box). However, installing the server
isn't enough. You'll need to configure the LPD service to provide a
number of queues that users can use for printing. You can find an
excellent procedure for performing the LPD configuration at http://www.le.ac.uk/cc/dsss/docs/print-lpr.shtml.
If you're serious
about providing Linux print services through an LPD server, you might
want to use one of the better utilities on the market. A good starting
product is the SDI LPD server found at http://www.sdisw.com/LPD/default.htm.
This server provides a nice graphical interface that makes it easy to
manage your print queues. In addition, because this product is
share-ware, you can try it before you buy it.
|
|
Once you have a
printer configured to use LPD, you might wonder how to access it. The
LPQ utility lets you see the status of the printer. The LPR utility lets
you send output to the printer. Interestingly enough, these same
utilities appear on both Macintosh and Linux systems, which is why these
systems can access the LPD server on your Windows machine without
problem. Both of these utilities work at the command line as described
in the following sections.
NOTE
You won't find the LPQ or LPR utilities in the normal location on a Server Core system. Look instead in the \Windows\winsxs\x86_microsoft-windows-p..ting-lprportmonitor_31bf3856ad364e35_6.0.6001.16606_none_b409dc313dc8ecb7
folder of your hard drive for these executables. Except for the odd
location, the utilities work the same as they do for older versions of
Windows. Microsoft seems to be slating these utilities for departure
since they don't appear in Vista at all.
1. Troubleshooting the Line Printer Daemon with the LPQ Utility
The Line Printer Queue
(LPQ) utility provides status information that you can use to
troubleshoot a LPD server. You can use this utility to display the
status of each document in the queue. You may also use the LPD Print
Service instead of this utility to obtain maximum functionality. This
utility uses the following syntax:
LPQ -Sserver -Pprinter [-l]
The following list describes each of the command line arguments.
-S
server
Defines the name
or IP address of the server hosting the LDP service. You use the
standard network name of the machine when working with Windows. Notice
that there isn't any space between the -S command line switch and the server name. In addition, the command line switches for this utility are case sensitive; typing -s or /s isn't the same as typing -S.
-P
printer
Specifies the name of
the LDP printer queue. This isn't the name of the printer, but the name
of the printer entry you create as part of setting up an LPD server.
The name you see in the Printers and Faxes folder is the same as the
name of the LPD server queue for that printer.
-l
Displays the
server information in verbose mode. This setting doesn't make much of a
difference on Windows systems; you see the same information. However,
you might see more information when accessing other platforms such as
Linux. Note that this command line switch is a lowercase L.
Using the LPQ
utility is relatively easy. For example, my machine's name is Main and I
configured a LaserJet printer connection on it using the techniques
described earlier in this section. Typing LPQ -SMain -PLJ5 at the command prompt provides the display shown in Figure 12.1.
There's nothing odd or
strange about using an LPD server on Windows. Any printer you configure
this way still provides the same management window as any other printer
you connect to your machine or access from the network. You can use this
GUI display to manage the print jobs in the queue. These features
include all of the standard Windows features, such as changing job
priority, pausing a job, or canceling all jobs. The only difference is
the server used to service the print queue.
|
|
2. Sending a Print Job to a Printer with the LPR Utility
The Line Printer
Request (LPR) utility sends a print job to the printer. When working at
the command line, you'll normally send text files, but the LPR utility
can also accommodate binary files and PostScript. You may also use the
LPR Port Monitor instead of this utility to obtain the latest support.
This utility uses the following syntax:
LPR -S server -P printer [-C class] [-J job] [-o option] [-x] [-d] filename
The following list describes each of the command line arguments.
-S
server
Defines the name
or IP address of the server hosting the LDP service. You use the
standard network name of the machine when working with Windows. Notice
that there isn't any space between the -S command line switch and the server name. In addition, the command line switches for this utility are case sensitive; typing -s or /s isn't the same as typing -S.
-P
printer_queue
Specifies the name
of the LDP printer queue. This isn't the name of the printer, but the
name of the printer entry you create as part of setting up an LPD
server. The name you see in the Printers and Faxes folder is the same as
the name of the LPD server queue for that printer.
-C
class
Defines the job classification to use for the burst page. You must define print jobs for the server to use this feature.
-J
job
Defines the job name to print on the burst page. You must define print jobs for the server to use this feature.
-o
option
Determines
the type of the file. The default setting is a text file. The only
standardized option value is a 1, which indicates a binary or PostScript
file. The presence of this option doesn't mean that the printer can
handle the file you send or that Windows won't strip control characters.
Make sure you read the Microsoft Knowledge Base articles on this topic,
such as the one found at http://support.microsoft.com/kb/124735/EN-US/, before you create binary print jobs.
-x
Enforces
compatibility with SunOS4.1.x and prior version when working with a
remote printer (you can read more about SunOS4.1.x and its successor at http://www.sun.com/bigadmin/content/misc/solaris2faq.html).
-d
Places this data file at the front of the print queue. The default is to place the data file at the end of the queue.
Generally, you won't need
to use all of the LPR options. For example, you can print a text file on
a Windows machine simply by specifying the server name, the print
queue, and the name of the file as shown here:
LPR -SMain -PLJ5 MyDir.TXT
NOTE
Once you establish an
LPD server on your system, you can use the associated printer as you
would any other printer from Windows applications. Consequently, the LPR
utility is like any other command line utility for printing—it lets you
create basic output from the command line. However, LPD servers and
their associated printers require special setup to pass control
characters and other non-ASCII data. Make sure you understand and
configure your LPD server setup before you use it for general
application output.