PrintDocumentOnPrintProcessor function

A print processor's PrintDocumentOnPrintProcessor function converts a print job from a spooled format into raw data that can be sent to a print monitor.

Syntax


BOOL PrintDocumentOnPrintProcessor(
  _In_ HANDLE hPrintProcessor,
  _In_ LPWSTR pDocumentName
);

Parameters

hPrintProcessor [in]

Caller-supplied print processor handle. This is the handle returned by a previous call to OpenPrintProcessor.

pDocumentName [in]

Caller-supplied pointer to the document name.

Return value

If the operation succeeds, the function should return TRUE. If the operation fails, the function should call SetLastError to set an error code, and then return FALSE.

Remarks

Print processors are required to export a PrintDocumentOnPrintProcessor function. The spooler calls the function after calling OpenPrintProcessor. The function's purpose is to read the contents of the file named by pDocumentName, convert (if necessary) the file's data to a data stream that can be read by printer hardware, and to send the data stream back to the spooler. The spooler can then send the data stream to the appropriate print monitor.

If the input format is NT-based operating system EMF, the PrintDocumentOnPrintProcessor function can call GDI functions for print processors. For more information, see Processing a Print Job.

The converted data stream must be sent back to the spooler by calling WritePrinter, which is described in the Microsoft Windows SDK documentation. For more information, see Processing a Print Job.

The PrintDocumentOnPrintProcessor function must be written to handle requests to pause, resume, or cancel the print job. For more information, see ControlPrintProcessor.

Requirements

Target platform

Desktop

Header

Winsplp.h (include Winsplp.h)

Library

Nwprint.lib

See also

OpenPrintProcessor
ControlPrintProcessor

 

 

Send comments about this topic to Microsoft

Show: