If the printer is remote lpd opens a connection to that machine and transfers the cf and df files spooled earlier. Once transferred, it deletes the spool files. If the printer is on the local machines a number of steps are performed. One of the features of bsd printing is that of filters. Filters operate as middleware in the pathway between the spool direcotory and the device.
Filters provide a means by which data can be transformed.
For example, in our environment we have QMS laser printers. While the QMS printers are supposed to automatically determine whether a job is postscript or ascii, it does this in a brain-dead manner. We have written a filter that examines the first few hundred lines of the file and does the determination for us. If it is postscript it prefixes some special commands at the beginning of the job, if ascii it uses a different set. Filters are also available for providing graphics conversion and document conversion.