Bewerken

Delen via


Win32 API support for print capabilities

Important

The modern print platform is Windows' preferred means of communicating with printers. We recommend that you use Microsoft's IPP inbox class driver, along with Print Support Apps (PSA), to customize the print experience in Windows 10 and 11 for printer device development.

For more information, see Modern print platform and the Print support app design guide.

The Windows Vista print subsystem provides compatibility support that enables Windows Presentation Foundation (WPF) applications to use GDI-based print drivers and enables Microsoft Win32-based applications to use XPSDrv print drivers. This compatibility is provided through a layer of software shims. Shims are software modules that perform transformation operations on the data so that otherwise incompatible software can interoperate. The following figure shows the data paths of this implementation for Print Capabilities.

diagram illustrating print capabilities data flows.

Both XPSDrv print drivers and GDI-based, version 3 print drivers support the DrvDeviceCapabilities function. When a Win32 application calls DrvDeviceCapabilities or the GetDevCap function, the print subsystem will call DrvDeviceCapabilities to collect the device capability information from the print driver.

When a WPF application requests a PrintCapabilities document from a print driver, the print subsystem will do one of the following:

  • If the print driver supports the IPrintTicketProvider interface, the print subsystem will query the print driver for the PrintCapabilities document by using the IPrintTicketProvider::GetPrintCapabilities method.

  • If the print driver does not support the IPrintTicketProvider interface, the Print Ticket Manager will query the DrvDeviceCapabilities function of the print driver and use the returned information to create a PrintTicket document that is returned to the application.

For more information about how the IPrintTicketProvider interface is supported by Microsoft print drivers, see Printer Driver and Plug-in Interface Design in Windows Vista.