The AddJob function obtains a path string that specifies a file that you can use to store a spooled print job.
BOOL AddJob(
HANDLE hPrinter, // specifies printer for the print job
DWORD Level, // specifies version of print job information
// data structure
LPBYTE pData, // pointer to buffer to receive print job
// information data
DWORD cbBuf, // specifies size of buffer pointed to by pData
LPDWORD pcbNeeded
// pointer to variable to receive size of print
// job information data
);
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
You can call the CreateFile function to open the spool file specified by the Path member of the ADDJOB_INFO_1 structure, and then call the WriteFile function to write print job data to it. Once that is done, call ScheduleJob to notify the print spooler that the print job can now be scheduled by the spooler for printing.
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in winspool.h.
Import Library: Use winspool.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT.
Printing and Print Spooler Overview, Printing and Print Spooler Functions, ADDJOB_INFO_1, CreateFile, OpenPrinter, ScheduleJob, WriteFile