PASSTHROUGH Printer Escape function

The PASSTHROUGH printer escape function sends data directly to a printer driver. To perform this operation, call the ExtEscape function with the following parameters.


int ExtEscape(
  _In_  HDC    hdc,
  _In_  int    nEscape,
  _In_  int    cbInput,
  _In_  LPCSTR lpszInData,
  _In_  int    cbOutput,
  _Out_ LPSTR  lpszOutData


  • hdc [in]
    A handle to the printer device context.

  • nEscape [in]
    The escape function to be performed.

    Value Meaning

    Allows the application to send data directly to a printer. Supported in compatibility mode and GDI-centric mode.


  • cbInput [in]
    The number of bytes of data pointed to by the lpszInData parameter.

  • lpszInData [in]
    A pointer to the input structure required for the specified escape. The first word in the buffer contains the number of bytes of input data. The remaining bytes of the buffer contain the data itself.

  • cbOutput [in]
    The number of bytes of data pointed to by the lpszOutData parameter.

    For this printer escape function, the value of this parameter is 0.

  • lpszOutData [out]
    A pointer to the structure that receives output from this escape.

    For this printer escape function, the value of the parameter is NULL.

Return value

The return value is greater than zero if the function is successful and less than zero if not. A return value of zero indicates that the printer does not support this escape.


The PASSTHROUGH printer escape function is supported by PostScript drivers in GDI-centric mode or compatibility mode, but not in PostScript-centric mode. Drivers in PostScript-centric mode can use the POSTSCRIPT_PASSTHROUGH escape function. To set a PostScript driver mode, call the POSTSCRIPT_IDENTIFY escape function.

For PASSTHROUGH data sent by EPSPRINTING or PostScript-centric applications, the PostScript driver will not make any modifications. For PASSTHROUGH data sent by other applications, if the PostScript driver is using BCP (Binary Communication Protocol) or TBCP (Tagged Binary Communication Protocol) output protocol, the driver does the appropriate BCP or TBCP quoting on special characters, as described in "Adobe Serial and Parallel Communications Protocols Specification." This means that the application should send either ASCII or pure binary PASSTHROUGH data.


Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]


Wingdi.h (include Windows.h)

See also


GDI Printer Escape Functions