MXDC_ESCAPE_HEADER_T

MXDC_ESCAPE_HEADER_T structure

The MXDC_ESCAPE_HEADER_T structure holds the operation code for a call to ExtEscape with MXDC_ESCAPE as the nEscape parameter. It also provides the sizes of the input and output buffers.

Syntax


typedef struct tagMxdcEscapeHeader {
  ULONG cbInput;
  ULONG cbOutput;
  ULONG opCode;
} MXDC_ESCAPE_HEADER_T, *P_MXDC_ESCAPE_HEADER_T;

Members

cbInput

The size of the input buffer that will be passed to the lpszOutData parameter of the ExtEscape function.

cbOutput

The size of the output buffer. This is the same value as the cbOutput parameter of the ExtEscape function.

opCode

The code constant that tells MXDC what to do.

Operations codeDescription
MXDCOP_GET_FILENAMEReturns, in the lpszOutData parameter of the ExtEscape function, either the full path of the output file as a zero-terminated string or the size of that string. See Remarks.
MXDCOP_PRINTTICKET_FIXED_DOC_SEQAssociates a print ticket with an XPS fixed document sequence.
MXDCOP_PRINTTICKET_FIXED_DOCAssociates a print ticket with an XPS document.
MXDCOP_PRINTTICKET_FIXED_PAGEAssociates a print ticket with an XPS page.
MXDCOP_SET_S0PAGESends the XPS markup of the current page to the output.
MXDCOP_SET_S0PAGE_RESOURCESends a resource on the page, such as an image or font, to the output.
MXDCOP_SET_XPSPASSTHRU_MODEPuts the MXDC into a pass-through state, enabling an application to write XPS directly to the output file without any processing by the MXDC. An entire document or even document sequence can be written in this way.

 

Remarks

Before calling MXDC_ESCAPE,_applications should first verify that the driver is MXDC by calling ExtEscape with the GETTECHNOLOGY escape. If the driver is the MXDC the function returns the zero-terminated string "http://schemas.microsoft.com/xps/2005/06".

This structure is always at the beginning of the data passed to the ExtEscape function in its lpszInData parameter.

When opCode is MXDCOP_GET_FILENAME:

  • The lpszInData parameter of the ExtEscape function consists of only the MXDC_ESCAPE_HEADER_T structure.
  • Obtain the output filename by calling ExtEscape twice.
    1. The first time, pass 4 to the cbOutput parameter of ExtEscape. Set the lpszOutData parameter to point to any allocated 4 bytes of memory. The size of the fully qualified file path will be returned in the lpszOutData parameter of ExtEscape.
    2. Then call the function again. This time set both cbOutput and cbInput to 4+ DataSize. The fully qualified file path will be returned in an MxdcGetFileNameData structure.

When opCode is MXDCOP_PRINTTICKET_FIXED_DOC_SEQ or MXDCOP_PRINTTICKET_FIXED_DOC:

When opCode is MXDCOP_PRINTTICKET_FIXED_PAGE:

When opCode is MXDCOP_SET_S0PAGE:

  • The lpszInData parameter of the ExtEscape function consists of the MXDC_ESCAPE_HEADER_T structure and an MxdcS0PageData structure concatenated into an MxdcS0PagePassthroughEscape structure.
  • The call to ExtEscape must occur between a call to StartPage and a call to EndPage.
  • The calling application is responsible for validating the XML.
  • Streaming consumption is more efficient if you call ExtEscape with MXDCOP_SET_S0PAGE_RESOURCE as opCode for each resource on the page before you call it with MXDCOP_SET_S0PAGE.

When opCode is MXDCOP_SET_S0PAGE_RESOURCE:

  • The lpszInData parameter of the ExtEscape function consists of the MXDC_ESCAPE_HEADER_T structure and an MxdcXpsS0PageResource structure concatenated into an MxdcS0PageResourceEscape structure.
  • The call to ExtEscape must occur between a call to StartPage and a call to EndPage, but there can be multiple such calls between the StartPage and EndPage calls.
  • Streaming consumption is more efficient if you call ExtEscape with MXDCOP_SET_S0PAGE_RESOURCE as opCode for each resource on the page before you call it with MXDCOP_SET_S0PAGE.

When opCode is MXDCOP_SET_XPSPASSTHRU_MODE:

  • The lpszInData parameter of the ExtEscape function consists of only the MXDC_ESCAPE_HEADER_T structure.
  • This call must occur before the call to StartDoc.

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Mxdc.h

See also

Printing
Print Spooler API Structures
GDI Printer Escape Functions
ExtEscape
MXDC_ESCAPE

 

 

Show:
© 2016 Microsoft