StartSpoolPage

  int FAR PASCAL StartSpoolPage(hJob)    
  HANDLE hJob;    

The StartSpoolPage function marks the start of a spooled page. A driver uses this function, in conjunction with the EndSpoolPage function, to divide printer output into pages. Each page is stored in a temporary file on the machine's hard disk when Print Manager is running. Dividing a print job into pages allows Print Manager to begin printing one page while the driver is still generating output on subsequent pages. A Print Manager page does not need to correspond to a physical page of printed output; the division is the driver's decision.

Parameters

hJob

Identifies the print job. The handle must have been previously opened using the OpenJob function.

Return Value

The return value is positive if the function is successful. Otherwise, it is one of the following error values.

Value Meaning

SP_ERROR (-1) A general error condition or general error in banding occurred.
SP_APPABORT (-2) The job was stopped because the application's callback function returned FALSE (0).
SP_USERABORT (-3) The user stopped the print job by choosing the Delete button from Print Manager.
SP_OUTOFDISK (-4) A lack of disk space caused the job to stop. There is not enough disk space to create or extend the Print Manager temporary file.
SP_OUTOFMEMORY (-5) A lack of memory caused the job to stop.

Comments

When Print Manager is not running, page division is not very important because temporary files are not involved. However, starting and ending at least one Print Manager page is still required.

Calls to StartSpoolPage and EndSpoolPage can occur at any point during the output. Some drivers use one spool page per physical page. Others use one page for the whole job. The printing of a particular page by the Print Manager application does not begin until it receives the corresponding EndSpoolPage function.

A driver can perform output at any point between these two calls. When EndSpoolPage is called and Print Manager is loaded, the page's temporary file is submitted to Windows Print Manager.

See Also

EndSpoolPage, OpenJob