WINPRINT-GET-PRINTER-MEDIA

This operation code allows you to access the paper sizes and paper trays supported by the printer driver.

Usage

CALL "WIN$PRINTER"
    USING WINPRINT-GET-PRINTER-MEDIA, WINPRINT-MEDIA
    GIVING RESULT

Parameters

WINPRINT-MEDIA Group item defined in winprint.def as follows:
01  WINPRINT-MEDIA.
   03  WINPRINT-MEDIA-PRINTER       PIC X(80).
   03  WINPRINT-MEDIA-PORT          PIC X(80).
   03  WINPRINT-MEDIA-PAPERCOUNT    SIGNED-SHORT.
   03  WINPRINT-MEDIA-TRAYCOUNT     SIGNED-SHORT.
   03  WINPRINT-MEDIA-PAPER         SIGNED-SHORT
                                    OCCURS MAX-PAPER-SIZES.
   03  WINPRINT-MEDIA-TRAYS         SIGNED-SHORT
                                    OCCURS MAX-PAPER-TRAYS.

Description

This operation may be called at any time a print job has started, or has started and closed. There is no need to reset this function. WINPRINT-MEDIA should be initialized prior to use.

WINPRINT-MEDIA has the following values:

WINPRINT-MEDIA-PRINTER Should be set to the value of WINPRINT-NAME as obtained through a call to WINPRINT-GET-PRINTER-INFO(-EX) or WINPRINT-GET-CURRENT-INFO(-EX).
WINPRINT-MEDIA-PORT Should be set to the value of WINPRINT-PORT from the WINPRINT-SELECTION op-code.
WINPRINT-MEDIA-PAPERCOUNT Returns the total number of paper sizes supported by the selected printer driver. This number varies from printer to printer. The maximum value is 41, even if the printer driver actually supports more sizes of paper.
WINPRINT-MEDIA-TRAYCOUNT Returns the total number of paper trays supported by the printer driver. This number varies from printer to printer. The maximum value is 13, even if the printer driver actually supports more paper trays.
WINPRINT-MEDIA-PAPER Returns an array of supported paper sizes. The array is limited to a maximum of 41 possible sizes. Each number in the array corresponds to a paper size defined by WINPRINT-CURR-PAPERSIZE in "winprint.def". The numbers in the array may not appear in sequential order (1,2,3...). If WINPRINT-MEDIA-PAPERCOUNT returns a value less than 41, values between the returned count and 41 are undefined. Values over 41 are not defined by the Windows API, and may be undefined, device specific or user-defined.
WINPRINT-MEDIA-TRAYS Returns an array of supported paper trays. The array is limited to a maximum of 13 possible trays. Each number in the array corresponds to a paper tray defined by WINPRINT-CURR-TRAY in winprint.def. The numbers in the array may not appear in sequential order (1,2,3...). If WINPRINT-MEDIA-TRAYS returns a value less than 13, values between the returned count and 13 are undefined. Values over 13 are not defined by the Windows API, and may be undefined, device specific or user-defined.