Win32 DeviceCapabilities API behavior changes
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.
A Unidrv/PScript5 driver that is running in XPSDrv mode creates the following changes in the Microsoft Win32 DeviceCapabilities function.
When a GPD/PPD feature or option is mapped to a Print Schema keyword by using GPD's PrintSchemaKeywordMap or PPD's MSPrintSchemaKeywordMap keywords, GPD or PPD supports that print schema keyword.
(In the following table, "PS only" means the behavior change is specific to a PScript5 driver. "Unidrv only" means the behavior change is specific to Unidrv driver. If both of these phrases don't appear, the behavior change applies to both Unidrv and PScript5 drivers.)
Capability | Non-XPSDrv behavior | XPSDrv behavior |
---|---|---|
DC_COPIES | (Unidrv only) When EMF is enabled, DeviceCapabilitiesreturns a hard-coded value that is the maximum value of 9999 or the GPD file's specified *MaxCopies value. When EMF is disabled, DeviceCapabilities returns the GPD*MaxCopies value. (PS only) DeviceCapabilities returns a hard-coded value of 9999. |
(Unidrv only) DeviceCapabilities returns the GPD *MaxCopies value. (PS only) DeviceCapabilities returns the PPD file's *MSXPSMaxCopies value or 1 if the value isn't specified in the PPD file. |
DC_TRUETYPE | For Unidrv, if the *FontFormat GPD keyword is specified, DeviceCapabilities returns (DCTT_BITMAP | DCTT_DOWNLOAD); otherwise, DeviceCapabilities returns DCTT_BITMAP. For PS, DeviceCapabilities always returns (DCTT_DOWNLOAD | DCTT_SUBDEV). |
If GPD or PPD supports a feature with the "PageDeviceFontSubstitution" Print Schema keyword, the DCTT_SUBDEV flag is set in the return value. If GPD or PPD supports a feature with the "PageTrueTypeFontMode" Print Schema keyword, the following occur: If the feature supports an option with the "DownloadAsOutlineFont" Print Schema keyword, both the DCTT_DOWNLOAD and DCTT_DOWNLOAD_OUTLINE flags are set in the return value. If the feature supports an option with the "Automatic", "DownloadAsRasterFont", or "DownloadAsNativeTrueTypeFont" Print Schema keyword, the DCTT_DOWNLOAD flag is set in the return value. If the feature supports an option with the "RenderAsBitmap" Print Schema keyword, the DCTT_BITMAP flag is set in the return value. If none of the DCTT_Xxx flags are set, DeviceCapabilities returns 0. |
DC_ORIENTATION | (PS only) DeviceCapabilities returns 90 or 270 based on PPD's *LandscapeOrientation value and setting for the hard-coded Rotated Landscape orientation option in the input DEVMODE structure. | (PS only) The default return value is 0, which means that there's no landscape orientation. If PPD supports a feature with the "PageOrientation" Print Schema keyword, the following occur: If the feature supports an option with the "Landscape" Print Schema keyword, DeviceCapabilities returns 90. If the feature supports an option with the "ReverseLandscape" Print Schema keyword, DeviceCapabilities returns 270. |
DC_COLLATE | When EMF is enabled, DeviceCapabilities is hardcoded to return 1 (which means that collating is supported). When EMF is disabled, DeviceCapabilities returns 1 if GPD or PPD specifies Collate as a supported feature and if the Collate GPD or PPD feature isn't constrained by any device setting features. Otherwise, DeviceCapabilities returns 0. |
The behavior is the same as for non-XPSDrv drivers with EMF disabled. |
DC_NUP | DeviceCapabilities returns a hard-coded value to indicate support for 1, 2, 4, 6, 9, or 16 ups. | If GPD or PPD defines a feature with the "DocumentNUp" Print Schema keyword (the "DocumentNUp" feature is only used if no "JobNUpAllDocumentsContiguously" feature exists), then for any options of that feature that have the option GPD/PPD keyword name as a numeric number (that is, 1, 2, 6, and so on), the numeric number is reported as one of the supported pages per sheet value. Otherwise, XPSDrv reports that NUp isn't supported. |
DC_PERSONALITY | Unidrv returns the string defined by Personality orrcPersonalityID GPD keyword. PS always returns "PostScript". |
Keep the behavior the same as it is for non-XPSDrv drivers. |
DC_MEDIAREADY | If the Form-Tray assignment table is ever created, DeviceCapabilities returns the unique form names that are listed in the table that has an assigned tray. If Form-Tray assignment table isn't created, DeviceCapabilities returns "Letter" for nonmetric system default locale, "A4" for metric system default locale, or a GPD or PPD defined default paper size if the printer doesn't support "Letter" and "A4". |
The behavior is the same as with non-XPSDrv with no form-tray assignment table created. |
DC_STAPLE | (PS only) PPD doesn't have a single "Stapling" feature. A PScript5 driver checks if any of following PPD features are defined in PPD and not constrained by device settings to determine if the device can support stapling. "StapleLocation" "StapleX", "StapleY" "StapleWhen" "StapleOrientation" |
(PS only) If PPD supports a feature with the "JobStapleAllDocuments" or "DocumentStaple" Print Schema keyword, DeviceCapabilities returns 1 to indicate supporting stapling. Otherwise, DeviceCapabilities returns 0. |