The print service allows you to set up a single printer with multiple names to perform multiple functions. For example, if your printer supports both portrait and landscape modes, you can set up a different name for each function and then send jobs to each printer name. These multiple printers are called ``virtual printers''.
The print spooler system differentiates printers by name only, not by the device to which the printer is connected. To specify different names for the same device and prevent multiple print jobs from appearing simultaneously, you must set up both the real printer and additional virtual printers. The real printer performs the actual printing and the virtual printers pass print jobs to the real printer.
For example, to set up two virtual printers, port and land, that use the capabilities of an Hewlett-Packard LaserJet, use this procedure:
port: lp -dreal -oportrait land: lp -dreal -olandscapeThis specifies that when printing to printer land, the print system sends the print job to printer real using the -olandscape option (to print in landscape mode) and when printing to printer port, the print system sends the print job to printer real using the -oportrait option (to print in portrait mode)
This procedure translates the -dland option to lp to the necessary options for the printer (in this example, -dreal -ol).
Another way to accomplish this is to create a simple shell script to perform the type of printing. For example:
: # Land - shell script to print in landscape mode # # syntax: land <file> <file> ... # # lp -dreal -ol $@
The reasons for choosing one method over the other depend on how your applications access the print system. Many applications allow you to specify only the name of the printer, so virtual printers are the only solution. Other applications might allow complete control over the commands that submit the print job. In this case, you might use the shell script above.