The spooler stores a data type attribute with each document that specifies the format of the data. This can be, for example, raw data to be sent directly to the printer port, or a set of EMF files to be passed to the printer driver as they are despooled. An example of a print processor is a PostScript RIP, which reads PostScript code and rasterizes it into a bitmap for output.
A print processor might recognize one or more data types. For example, winprint handles three spool file formats: raw, text, and enhanced metafiles (EMFs).
The raw data type indicates that the print job has already been fully rendered by GDI/DDI, and it does not need any more processing. Raw data streams can be printed directly or can be put into spool files.
Most Windows NT printing clients send raw jobs. Raw spool files are device-dependent; that is, the spooled data is destined and formatted for a particular device and does not need to be printable on any other device. An example of a raw spool file is an encapsulated PostScript file, which is formatted to be understood by the PostScript printer for which it is destined. Another example of raw data is PCL.
When a print job’s data type is text, the print processor sends the incoming job the graphics engine. The graphics engine returns a print job which, when sent to the print device, prints the original text using the print device’s default paper source, with the default font, orientation, margins, and duplexing. This achieves the same result as saving the incoming job to a file, opening that file with Notepad, and then printing the job.
EMF spool files are used to greatly reduce the time duration between when an application-initiated print request occurs and when control is returned to the application by the operating system. This is done by recording the GDI function calls that produce the application’s graphic object on the specified printer in an EMF-format file, called a print spool file. The spool file can be built quickly this way and then control is returned to the application. Later, using a background thread, the Windows NT print spooler performs the more time-consuming task of executing the GDI calls so that the graphic object comes out on the printer.
A second advantage to the use of EMF spool files is device independence. The bulk of an EMF is an array of variable-sized records that encode the GDI function calls necessary to reproduce the picture when the EMF is “played back”. EMF spool files encode graphics information in such a way as to maintain device independence.
On Windows NT, EMF files are spooled locally and despooled by the server. One EMF file is created per print job. GDI puts font information into the EMF file if the server does not have this font information.