background image
X Version 11
Release 6.4
X Print Service Extension Library
15
XpCancelDoc cancels an in-progress document. If the job was started with output_mode XPGetData then the
data stream to
XpGetDocumentData is interrupted; no further data for the current document will be generated
but data for subsequent documents can be generated. For many page description languages such arbitrary
termination may invalidate the output.
If the job was started with output_mode
XPSpool then depending on the driver and spooler implementation
the entire document may be canceled or a partial document may be generated.
If discard is
True all XPPrintNotify events with a detail field of XPEndPageNotify or XPEndDocNotify are dis-
carded before
XpCancelDoc returns.
For clients selecting
XPPrintMask (see XpSelectInput), the event XPPrintNotify will be generated with its detail
field set to
XPEndDocNotify.
XpCancelDoc can generate one of the following errors:
XPBadContext
A valid print context-id has not been set prior to making this call.
XPBadSequence
The function was not called in the proper order with respect to the other X Print
Service Extension calls (example,
XpEndDoc prior to XpStartDoc).
2.2.6 Getting and Putting Data into Documents
Use
XpPutDocumentData to send and incorporate data into the output.
void XpPutDocumentData (display, drawable, data, data_len, doc_fmt, options)
Display *display;
Drawable drawable;
unsigned char *data;
int data_len;
char *doc_fmt;
char *options;
display
Specifies a pointer to the Display structure; returned from XOpenDisplay.
drawable
Specifies the destination drawable for rendering.
data
Specifies the device-specific data sent.
data_len
Specifies the number of bytes in data.
doc_fmt
Specifies the type of data sent. See below for valid values. String limited to XPCS
characters.
options
Specifies DDX driver dependent options. String limited to XPCS characters.
Depending on type for
XpStartDoc, XpPutDocumentData has two modes of operation.
In
XPDocRaw mode, XpPutDocumentData sends data directly to the output, and drawable must be None, else a
BadDrawable error will be generated. The X Print Server does not emit document or page control codes into
the output, and data is passed through unmodified. This is useful for sending previously constructed and
complete documents using the X Print Server's job control and submission capabilities. The printer attribute
xp-raw-formats-supported defines the valid values for doc_fmt in this mode, with unsupported values for
doc_fmt causing a
BadMatch error to be generated.
In
XPDocNormal mode, XpPutDocumentData sends data to the X Print Server, and depending on the DDX
driver implementation, integrates data into the output. The parameters doc_fmt and options describe the for-
mat of data which guides the DDX driver in interpreting data. The printer attribute
xp-embedded-formats-sup-
ported defines the valid values for doc_fmt in this mode, with unsupported values for doc_fmt causing a
BadMatch error to be generated.
If doc_fmt is not in either
xp-raw-formats-supported or xp-embedded-formats-supported a BadValue error is gen-
erated.