Submitting a Print Job Directly to the Spooler
The spooler provides functions that enable applications to submit print
data directly to a spool queue. Normally, these functions are used by printer
drivers to add a print job to a spool queue. However, this is not a recommended
method unless the application is special-purpose.
The advantage of submitting print data directly to a spool queue is to bypass
the GPI presentation layer. This can be useful, particularly, for sending
print jobs to a network printer that is on a server that does not run the
OS/2 operating system. However, there are certain requirements for direct
spooling:
- Because the data bypasses the printer presentation
driver, it must be in a format the printer can understand. Therefore, the
application must be aware of and send the printer-specific commands.
- If the spooler is not active, the print jobs never
will be printed.
The following steps are required to create a print job using the spooler
directly:
- Use SplQmOpen to open the PM. (Functionally,
this is similar to using DevOpenDC, which is detailed in Opening
a Queued Device Context.) You must specify a queue name of PMQOPENDATA
for the logical address element, pszLogAddress. PMQOPENDATA is a
data structure, identical to DEVOPENSTRUC,
to be used with the SplQmxxx functions.
- Use SplQmStartDoc to signal the start of your
document. (This is same as using DevEscape with DEVESC_STARTDOC as used
in PM printing.)
- Use SplQmWrite to write data to the spool file.
- Use SplQmEndDoc to signal the end of your document.
(This is the same as DevEscape with DEVESC_ENDDOC as used in PM printing.)
- Use SplQmClose to close the PM. (Functionally,
this is similar to DevCloseDC.)
[Back: Submitting a Direct Presentation Manager Print Job]
[Next: Spooler Management and Configuration]