]>
Printer drivers are used to add support for making print-outs of certain document formats. They are much like viewers, except that their output is supposed to go to a hardcopy device instead of to the screen.
Printer drivers are characterized by:
one or more MIME types (the types they know how to print)
a list of object files
a suffix (referred to as XXX
below)
The exported functions of printer drivers are almost the same as for viewers, that is:
Bool initXXX(char ***mime_types, int
*nrtypes)
Initializes private variables and returns the list of formats
that the applet accepts. (XXX
is replaced with the
unique suffix.) When an error occurs, the function sets the
errno
variable and returns FALSE
.
Bool openXXX(const W3ADocumentInfo info, long
id)
Directs the printer driver to start a new print job of the
type indicated in Question: Is it useful to have a
info
. The ID is theID used in
subsequent calls to writeXXX
and
closeXXX
. The function returns FALSE
in case of an error and sets errno to the error code.
flags
argument, so that non-blocking I/O can be
specified?
int writeXXX(long id, const char *buf,
const unsigned int nchars)
Sends characters to the printer driver. It is not necessary
(like it is with viewers) to make a call with nchars =
0
, to indicate that the end of the data is reached.
W3AcloseXXX
may be called immediately. The return
value is equal to
Bool closeXXX(long id)
Signals the end of the data. The printer driver should
invalidate (destroy) the