pdfGetNumMediaTypesW
Get the number of available media types (Unicode).
int pdfGetNumMediaTypesW(wchar_t *printerName)
This function returns the number of available media types on the
specified printer.
Note: pdfGetNumMediaTypesW
, pdfGetMediaTypeNameW
, and
pdfGetMediaTypeIDW
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).
C:
wchar_t mediaTypeName[256];
int nMediaTypes, mediaTypeID, i;
nMediaTypes = pdfGetNumMediaTypesW(printerName);
for (i = 0; i < nMediaTypes; ++i) {
pdfGetMediaTypeNameW(printerName, i, mediaTypeName, sizeof(mediaTypeName) / sizeof(wchar_t));
mediaTypeID = pdfGetMediaTypeIDW(printerName, i);
printf("media type %d: id=%d name=%ls\n", i, mediaTypeID, mediaTypeName);
}