getMediaTypeID

Get a media type ID.
getMediaTypeID([in] BSTR printerName, [in] int mediaTypeIdx, [out, retval] int *mediaTypeID)
This function returns the ID for the mediaTypeIdxth available media type, on the specified printer.

mediaTypeIdx must be between 0 and n-1, where n is the value returned by getNumMediaTypes.

The returned value can be used to set the mediaTypeID property.

Note: getNumMediaTypes, getMediaTypeName, and getMediaTypeID are just simple wrappers around Windows functions. There is no requirement to use these functions if you already know the media type ID that you want to use (e.g., from calling DeviceCapabilities with the DC_MEDIATYPES argument).

VB6:
nMediaTypes = pdf.getNumMediaTypes(printerName) For i = 0 To nMediaTypes - 1 mediaTypeName = pdf.getMediaTypeName(printerName, i) mediaTypeID = pdf.getMediaTypeID(printerName, i) Print "media type " & i & ": id=" & mediaTypeID & " name=" & mediaTypeName Next i
getNumMediaTypes
getMediaTypeName