The handling routine in the presentation driver discards all data (such
as data in a spooler buffer or journal file) received for the current document
and closes any files associated with it. The current document is defined
as any data back to, and including, the DEVESC_STARTDOC statement.
This function applies to hardcopy drivers only.
The following are three scenarios for ending a job and the steps to be taken
by a hardcopy driver:
- The user ends a job:
a.
The spooler calls SplQpControl(SPLC_ABORT).
b.
The queue driver calls DevEscape(DEVESC_ABORTDOC).
c.
The hardcopy driver sets
a flag indicating that the job was aborted and returns the DevEscape(DEVESC_ABORTDOC)
thread. The next time PrtWrite returns, the hardcopy driver completes the
current page, for example, by sending a form feed and some null data to
make sure the printer is not in graphics mode.
d.
The
hardcopy driver calls PrtClose.
Note: The
hardcopy driver must be able to accept DEVESC_ABORT while processing data
or DEVESC_ENDDOC.
2.
The
printer runs out of paper or is offline:
a.
The spooler function PrtWrite fails and returns
an error to the hardcopy driver.
b.
If
the job ended, the hardcopy driver calls PrtClose. Otherwise, it calls SplMessageBox.
c.
The spooler brings up
a message box or sends a message to the user, holds the job, and waits on
a semaphore until the job is released (possibly across the network), in
which case it will return RETRY. If the user selects ABORT, the hardcopy
driver calls PrtAbort and PrtClose. If the user selects RETRY, the hardcopy
driver will try PrtWrite again (see above).
Note:
The spooler will ignore all PrtWrite operations after PrtAbort is called.
After the hardcopy driver has called PrtClose, it should return errors until
the DC is closed.
3.