When a user prints from your Microsoft Windows 3.1 application, the resulting output depends not only on the data your application sends to the printer, it also depends on the current print settings for that printer. Print settings can include information such as page size, print orientation, or which paper bin to use.
The simplest way to print (illustrated in Chapter 12, “Printing”) uses the current print settings without validating or changing them. This approach works as long as the settings are appropriate for your application's requirements. If the settings are not appropriate, your application's printed output could be less than ideal. For example, if your application prints a spreadsheet that requires a landscape print orientation on a printer that is set up for portrait orientation, your application's data will probably run off the right side of the paper.
With the Windows operating system, your application can change the print settings to fit the situation (for example, changing the print orientation to landscape, or specifying a different paper bin). After your application has tailored the print settings, it can print using those settings.
Because print settings differ from printer to printer, an application must interact with a printer's device driver in order to change the settings for that printer. Most printer drivers for Windows provide special functions that your application can use to control print settings easily.
This chapter explains how to use these printer-driver functions to control print settings. It covers the following topics:
How Windows manages print settings
Using device-driver functions
Finding out the capabilities of a printer driver
Controlling print settings
Copying print settings from one driver to another
Letting the user change the print settings
Working with drivers written for previous versions of Windows