The printer-driver environment consists of information about the printer, such as font cartridges, paper trays and sizes, printer orientation, graphics capabilities, color, and other advanced features. Windows applications use this information to create printed output that takes full advantage of the printer environment.
Printers normally have a large number of options from which the user can select. This information can come from any of four sources:
The driver's default setup.
The driver's WIN.INI section of user options. The WIN.INI should maintain at least one such section so that modified printer setups can be retained from session to session. This information is edited by the driver's Setup dialog box.
The driver may call GDI to retain the driver's environment from device context to device context on a port-by-port basis. This allows faster initialization of the driver and avoids the time-consuming process of reading options from the WIN.INI file.
The application can pass the environment to the driver in a buffer pointed to by the lpInitData parameter of the Enable function.
Upon device initialization (that is, during the pair of Enable functions), this information is used to set up information in the GDIINFO and PDEVICE structures. For example, the paper size selection will affect the height and width fields. Also, a printer that allows multiple graphics densities will modify the various resolution fields.