When users print, the computer completes several steps that involve a set of components including executable files, drivers, device interfaces, and dynamic-link libraries, which work together to create the printed output. Understanding how this process works helps you understand what happens when you print a document and how to solve printing problems. Printing has two parts: printing process and the print components. The two parts make the printing process possible. When printing to an Internet print server, the print server adds to the standard print process by creating an interface for users.
A printer pool associates two or more identical printers with one set of printer software. To set up a printer pool, add a printer by using the Add Printer wizard, and then assign an output port to all printers that are identical to the original printer. Windows 2000 does not limit the number of printers in a pool. When a document is sent to the printer pool, the first available printer prints it. This configuration maximizes printer use and minimizes the wait for completed print jobs.
Efficient printer pools have the following characteristics:
All printers in the pool are the same model.
Printer ports can be of the same type or mixed, such as parallel, serial, and network.
It is recommended that all printers be in one physical location because it is impossible to predict which printer receives the document, making it hard for users to find their print job.
Note | When print jobs are sent through a standard TCP/IP port to devices that are RFC 1759 compliant, and the printer in a pool stops printing after a set time, the current document is rescheduled on another port. Succeeding documents print to other printers in the pool until the nonfunctioning printer is fixed. |
The printing process is divided into three phases:
Client processes
Spooler processes
Printer processes
These groups of steps include the following specific actions, shown in Figure 11-2.
Figure 11-2: Printing process
The steps depicted in Figure 11-2 include the following:
The client processes include:
A user sends a print job from an application. The application calls the Graphics Device Interface (GDI).
The GDI calls the printer driver for information, which the GDI uses to create a job in printer language.
The GDI delivers the job to the spooler.
The spooler processes include:
The client side of the spooler (Winspool.drv) makes a remote procedure call (RPC) call to the server side spooler (Spoolsv.exe).
Spoolsv.exe calls the print router (Spoolss.dll).
The router (Localspl.dll) sends the print job to the local print provider (LPP) or the remote print server if the job is being sent to a network printer.
The LPP polls print processors to find one that can handle the data type of the job.
The LPP sends the job to the print processor, which modifies the job as required to make it print properly.
The print processor sends the job to the page separator. A separator page is added if required.
The job is sent to the appropriate port print monitor. If print is bidirectional, the job is first sent to a language monitor, such as the Printer Job Language (PJL) monitor, and then sent on to the port monitor. If the job is unidirectional, the job is sent directly to the port monitor.
The printer processes include:
The printer receives the print job from the print spooler.
The printer translates the print language into a bitmap, which it then prints.
Many components work together to make the printing process possible. Different components are used at different times, depending on the type of print job being produced and the types of hardware being used.
The application calls the Graphics Device Interface (GDI) to begin the process of creating a print job. The GDI reads the driver information for the printer to get information about how to format the job. Using the document information from the application and the print device information from the printer driver, the GDI renders the print job in a language that the printer reads.
Printer drivers contain information that is specific to the printer that is used. Printer drivers reside on users computers and are used by the GDI to render print jobs.
Windows XP Professional includes the most common printer drivers, but you might need to provide third-party printer drivers for some printers. When a Windows XP Professional user connects to a printer or installs a Plug and Play printer, the necessary printer drivers are loaded onto the user s computer, if they are available in Windows XP Professional.
The print spooler consists of a group of components that include the print router, the local and remote print provider, the print processor, and the language and port monitors. These components can reside on both the computer sending a job and the network print server receiving print jobs. The print spooler s components take the print job that the GDI creates, and then modify it so that it has all the required information and formatting to print correctly. If part of the spooler is on a server, the server provides the processing resources for the print job, freeing the user s computer and improving performance.
Different print servers have different spooler components. In Windows 2000 Server, the print spooler is made up of a router, remote print provider, local print provider, print processor, separator page processor, and language and port monitors.
The print router receives a print job and locates an available print provider that can handle the print job s protocol. For example, the router might look for a print provider designed to handle RPC print jobs or jobs that were transferred by using HTTP. When an acceptable print provider is found, the router relays the print job from the remote print provider to the chosen local print provider, where the job is modified as needed before printing.
The remote print provider is part of the client side of the print process. The router gives control of the print job to the first remote print provider the router finds that recognizes the destination printer. A remote print provider sends the print job to the server router only.
Examples of remote print providers include the Windows Network Print Provider and the Novell NetWare Remote Print Provider. When a user sends a print job to a printer on a print server, the remote print provider is on the user s computer and the local print provider is on the server.
The local print provider receives the print job, writes it to a spool file, and keeps track of information about the job. Spooling a file to disk ensures that the job is saved and printed even if printers are unavailable or a power failure occurs.
The local print provider has two components that are required by the printer type and settings:
The print processor makes necessary modifications to the print job, and then calls the GDI to render the job. This is important when third-party printers have special requirements. Often, modifications are not required.
The separator page processor adds separator pages as required. You can specify separator pages based on your needs. Most separator pages include information such as the user and computer that created the job, or the date and time the job was created. You can configure the separator page on the Advanced tab of the Printer Properties page.
The escape codes used in creating a separator page are listed in Table 11-4.
Escape Code | Function |
---|---|
\ | The first line of the separator file must contain only this character. The separator file interpreter reads the separator file command as a delimiter. |
\N | Prints the user name of the person who submitted the job. |
\I | Prints the job number. |
\D | Prints the date the job was printed. The time is displayed in the format specified under Regional and Language Options in Control Panel. |
\Lxxx | Prints the string of text that appears after the \L escape code. If you enter \LTest, the text Test appears in the separator page. |
\Fpathname | Prints the contents of the file specified by the pathname, starting on an empty line. The contents of this file are copied directly to the printer without processing. |
\Hnn | Sets a printer-specific control sequence, where nn is a hexadecimal ASCII code sent directly to the printer. See your printer manual to determine the specific numbers. |
\Wnn | Sets the width of the separator page. The default width is 80 characters, and the maximum width is 256 characters. Characters beyond this width are deleted. |
\B\S | Prints text in single-width block characters until \U is encountered. |
\E | Ejects a page from the printer. Use this code to start a new separator page or to end the separator page file. If you get an extra blank separator page when you print, remove this code from your separator page file. |
\n | Skips the number of lines specified by n (from 0 through 9). Skipping 0 lines moves printing to the next line. |
\B\M | Prints text in double-width block characters until \U is encountered. |
\U | Turns off block character printing. |
After the local print provider passes a job through the print processor and separator page processor, it sends the job from the spooler to the appropriate port print monitor.
Windows XP Professional supports two kinds of print monitors:
Language monitors
Port monitors
Port monitors are subdivided into:
Local port monitors
Remote port monitors
Windows XP Professional provides three types of print monitors: language, local port, and remote.
The language monitor provides the language that the client and printer use to communicate. If the printer is bidirectional, the language monitor allows you to monitor printer status. You can request configuration and status from the printer, and the printer sends unsolicited status (such as Paper tray empty ) to the client.
The local port monitor (Localspl.dll) controls parallel and serial input/output (I/O) ports where a printer might be attached. It sends print jobs to local devices, including those on familiar ports such as LPT1 and COM1.
The remote port monitor includes all other port monitors supplied with Windows XP Professional, and it enables printing to remote printers. An example is Lanman Print Services Port.
The local print provider (Localspl.dll) that comes with Windows XP Professional includes the local port monitor and the Winprint print processor. The local port monitor controls the parallel and serial ports to which printers are connected. The standard port monitor is used for most network print jobs. Port monitors such as the NetWare Port Monitor or AppleTalk Port Monitor control other ports, such as TCP/IP or Ethernet.
Windows XP Professional includes port monitors that enable printing to different types of printers in different network environments. Some of the port monitors included with Windows XP Professional are described in further detail below:
The preferred network port monitor in Windows XP Professional is the standard port monitor. SNMP is used to configure and monitor the printer ports. In addition to the standard port monitor, Internet printing adds an HTTP print provider. For more information, see Methods of Sending Print Jobs earlier in this chapter.
The local port monitor is the standard monitor for printers connected directly to your computer. If you add a printer to your computer by using a serial or parallel port (such as COM1 or LPT1), this monitor is used.
The USB port monitor is the monitor used for USB printers connected directly to your computer. If you plug your USB printer into your computer, this monitor is used.
LPR Port monitor is used to send jobs over TCP/IP to a print server or printer running an LPD service. LPR Port monitor can be used as an alternative to the standard port monitor to Unix print servers. Use LPR Port if your LPD target server requires an RFC 1179-compliant Line Printer Remote protocol.
Note | The standard port monitor is the preferred port monitor for Windows XP Professional. The standard port monitor supports the RAW protocol, TCP/IP printing, and the non-RFC LPR protocol. |
PJL Monitor (Pjlmon.dll) communicates in printer job language (PJL). Any bidirectional print device that uses a bidirectional port monitor that uses PJL can use the PJL language monitor.
A user on a computer that runs Windows XP Professional can access information about available printers and send jobs to those printers on a Windows 2000 print server, or send to any print server that supports IPP v1.0. For finding an Internet printer and sending a print job to that printer, the following must occur:
A user connects to a Windows 2000 print server over the Internet by typing the URL for the print device.
The print server requires the client to provide authentication information. This ensures that only authorized users print documents on your printer, rather than making it available to everyone with an Internet connection.
After a user has authorized access to the print server, the server presents status information to the user by using Active Server Pages (ASP), which contain information about currently available printers.
Windows XP Professional users can connect to any of the available printers by using ASP and can get information about each printer s capabilities.
After users connect to an Internet printer, they can send documents to the print server by using IPP v1.0. IPP sends the job to the designated Internet printer.
Note | Only computers that run Microsoft Windows 95, Microsoft Windows 98, Microsoft Windows Millennium Edition (Me), or Microsoft Windows 2000 and that use the Internet Printing Client, can connect to available printers. Microsoft Windows NT and Microsoft Windows 3.1 cannot connect. |
Figure 11-3 shows the steps that the Internet printing process might include.
Figure 11-3: Internet printing process
Print jobs are sent in a variety of formats, each suited to different computing environments.
Enhanced Metafile (EMF) is the standard format for print jobs created on Windows XP Professional. EMF files are highly portable because the instructions for the print job are assembled on the user s computer, and the spooler completes the processing of the print job.
EMF data is created by the GDI. After an EMF job is sent to the spooler, control is returned to the user, and the spooler finishes processing the job. This limits how long the user s computer is busy.
RAW is a common data type for clients other than Windows. The spooler does not modify RAW data. It is sent directly to the printer.
RAW [FF Appended] is exactly like the RAW data type, except that a form-feed character is appended to the end of each print job. The last page of a RAW document does not print on a Printer Control Language (PCL) printer, so appending a form feed is necessary.
RAW [FF Auto] is exactly like the RAW data type, except the spooler checks the document for a form-feed character at the end of the job. If there is no form feed, the spooler adds one.
Text tells the spooler that the data is ANSI text and modifies it if necessary. The print processor takes the text and calls GDI for playback. The text is printed using the printer s default font.
Text data is composed of values from 0 through 255. Each value represents a different character. This data type is based on the ANSI standard, and if an application that has another character set creates text data it does not print. This often presents a problem in the extended character range, represented by values above 127.