IPrintSchemaCapabilities::GetFeatureByKeyName method

Gets a feature from the PrintCapabilities based on a given key name.


HRESULT GetFeatureByKeyName(
  BSTR                bstrKeyName,
  IPrintSchemaFeature **ppFeature



The key name of the feature.


The returned feature.

Return Value

This method returns an HRESULT value.


Only the following feature key names are recognized. The key names are equivalent to public Print Schema feature names as shown in the following table. The table also shows the features that have specialized option types (by default the option type is IPrintSchemaOption).

Name Print schema feature public name Specialized option type
DocumentBinding DocumentBinding or JobBindAllDocuments
DocumentCollate DocumentCollate
DocumentDuplex JobDuplexAllDocumentsContiguously
DocumentHolePunch DocumentHolePunch or JobHolePunch
DocumentInputBin JobInputBin, DocumentInputBin or PageInputBin
DocumentNUp JobNUpAllDocumentsContiguously IPrintSchemaNUpOption
DocumentStaple JobStapleAllDocuments or DocumentStaple
PageMediaSize PageMediaSize IPrintSchemaPageMediaSizeOption
PageMediaType PageMediaType
PageOrientation PageOrientation
PageOutputColor PageOutputColor
PageOutputQuality PageOutputQuality

When the requested feature, option or property is not found, this method returns S_FALSE and sets a NULL pointer on the output object of the feature, option or property.

So if the IPrintSchemaTicket object does not contain the specified feature, option or property, the app must obtain an IPrintSchemaCapabilities object and query it via IPrintSchemaCapabilities::GetFeatureByKeyName or via IPrintSchemaCapabilities::GetFeature.


Minimum supported client Windows 8
Target Platform Desktop
Header printerextension.h

See Also