GetJobAttributesEx function (winsplp.h)

Warning

Starting with Windows 10, the APIs which support third-party print providers are deprecated. Microsoft does not recommend any investment into third-party print providers. Additionally, on Windows 8 and newer products where the v4 print driver model is available, third-party print providers may not create or manage queues which use v4 print drivers.

A print provider's GetJobAttributesEx function obtains information about a print job, including N-up and reverse printing options.

Syntax

BOOL GetJobAttributesEx(
  [in]  LPWSTR     pPrinterName,
  [in]  LPDEVMODEW pDevmode,
  [in]  DWORD      dwLevel,
  [out] LPBYTE     pAttributeInfo,
  [in]  DWORD      nSize,
  [in]  DWORD      dwFlags
);

Parameters

[in] pPrinterName

Caller-supplied pointer to a NULL-terminated Unicode string that contains the printer name.

[in] pDevmode

Caller-supplied pointer to a DEVMODEW structure that is passed to the print processor or printer driver.

[in] dwLevel

Caller-supplied value that indicates the type of structure pointed to by pAttributeInfo, as indicated in the following table. For more information, see the Remarks section below.

dwLevel value Structure pointed to by pAttributeInfo
1 ATTRIBUTE_INFO_1
2 ATTRIBUTE_INFO_2
3 ATTRIBUTE_INFO_3
4 ATTRIBUTE_INFO_4

[out] pAttributeInfo

Caller-supplied pointer to an attribute information structure (ATTRIBUTE_INFO_1, ATTRIBUTE_INFO_2, ATTRIBUTE_INFO_3, or ATTRIBUTE_INFO_4) that receives information about the print job.

[in] nSize

Size of the buffer, in bytes, pointed to by pAttributeInfo.

[in] dwFlags

If set by the caller to FILL_WITH_DEFAULTS, then the spooler will fill pAttributeInfo with default values from level 1 up to the level specified by dwLevel.

For example, if dwLevel is 4 and FILL_WITH_DEFAULTS is specified, pAttributeInfo will be filled with the following default member values of ATTRIBUTE_INFO_4:

dwJobNumberOfPagesPerSide = 1

dwDrvNumberOfPagesPerSide = 1

dwNupBorderFlags = 0

dwJobPageOrderFlags = 0

dwDrvPageOrderFlags = 0

dwJobNumberOfCopies = dmCopies member of DEVMODEW

dwDrvNumberOfCopies = dmCopies member of DEVMODEW

dwColorOptimization = 0

dmPrintQuality = dmPrintQuality member of DEVMODEW

dmYResolution = dmYResolution member of DEVMODEW

dwNupDirection = RIGHT_THEN_DOWN

dwBookletFlags = BOOKLET_EDGE_LEFT

dwDuplexFlags = 0

dwScalingPercentX = 100

dwScalingPercentY = 100

dwJobHandlingFlags = 0

Return value

GetJobAttributesEx returns TRUE if it is successful in obtaining the print job attributes; otherwise, it returns FALSE.

Remarks

This function first checks whether the driver supports the attribute level that is indicated by dwLevel. If the driver does not support that attribute level, then the function queries the driver for support for the next lower level, (dwLevel - 1), and continues to query for progressively lower levels of support until it obtains the level of support provided by the driver. If dwFlags is set to FILL_WITH_DEFAULTS, then the function fills in the default values for the unsupported levels.

Requirements

Requirement Value
Target Platform Desktop
Header winsplp.h (include Winsplp.h)
Library Spoolss.lib
DLL Spoolss.dll

See also

ATTRIBUTE_INFO_3

ATTRIBUTE_INFO_4

DEVMODEW

GetJobAttributes