<div class="content" name="RpcStartPagePrinter" uuid="76261f54-4c63-4fc2-a2da-baee584e076b"><p>RpcStartPagePrinter notifies the spooler that a page is
about to be printed on the specified printer.</p><dl>
<dd>
<div><pre> DWORD RpcStartPagePrinter(
   [in] PRINTER_HANDLE hPrinter
 );
</pre></div>
</dd></dl><p><b>hPrinter: </b>A handle to a printer object or <span><a href="831cd729-be7c-451e-b729-bd8d84ce4d24#gt_ac027425-6043-4ad3-be27-56a381b75d38" data-linktype="relative-path">port</a></span>
object that was opened by <span><a href="bd0bb8d5-26fd-4705-81f5-614d32b9f38f" data-linktype="relative-path">RpcAddPrinter (section 3.1.4.2.3)</a></span>,
<span><a href="3af45717-308f-4b4f-8428-430d12856110" data-linktype="relative-path">RpcAddPrinterEx (section 3.1.4.2.15)</a></span>,
<span><a href="989357e2-446e-4872-bb38-1dce21e1313f" data-linktype="relative-path">RpcOpenPrinter (section 3.1.4.2.2)</a></span>,
or <span><a href="0e81ce18-72b1-46c3-8584-a205393b04ff" data-linktype="relative-path">RpcOpenPrinterEx (section 3.1.4.2.14)</a></span>.</p><p><b>Return Values: </b>This method MUST return zero
(ERROR_SUCCESS) to indicate successful completion or a nonzero Windows error
code to indicate failure <span><a href="../ms-erref/1bc92ddf-b79e-413c-bbaa-99a5281a6c90" data-linktype="relative-path">[MS-ERREF]</a></span>.</p><p>Upon receiving this message, the server MUST validate the
following:</p><ul><li><p><span><span> 
</span></span>Perform the validation steps that are specified in <span><a href="10bfa8c2-d456-4ad0-912d-e674766a36c8" data-linktype="relative-path">PRINTER_HANDLE
Parameters (section 3.1.4.1.11)</a></span>. This method SHOULD assume
that the handle to the printer or port object can be used without further
access checks.</p>
</li><li><p><span><span> 
</span></span>Verify that a job has been associated with <i>hPrinter</i> using <span><a href="90f95ff0-3ae0-4dde-a83d-35f457c710a6" data-linktype="relative-path">RpcStartDocPrinter</a></span>,
and if that verification fails, return ERROR_SPL_NO_STARTDOC [MS-ERREF].</p>
</li><li><p><span><span> 
</span></span>Verify that printing of the job has not been canceled, and if
that verification fails, return ERROR_PRINT_CANCELLED [MS-ERREF].</p>
</li></ul><p>If parameter validation fails, the server MUST fail the
operation immediately and return a nonzero error response to the client.
Otherwise, the server MUST process the message and compose a response to the client
as follows:</p><ul><li><p><span><span> 
</span></span>Update <span><a href="831cd729-be7c-451e-b729-bd8d84ce4d24#gt_12a6e569-e97c-4761-92f0-e397f8d5125f" data-linktype="relative-path">print job</a></span> statistics
to reflect incremented page count.</p>
</li><li><p><span><span> 
</span></span>Return the status of the operation.</p>
</li></ul><p>For each page of a print job, a <span><a href="831cd729-be7c-451e-b729-bd8d84ce4d24#gt_3b2da3d1-c159-4399-a6dd-dfd5f76fa2f5" data-linktype="relative-path">print client</a></span> SHOULD
perform the following sequence of actions:</p><ul><li><p><span><span> 
</span></span>call RpcStartPagePrinter.</p>
</li><li><p><span><span> 
</span></span>call <span><a href="6dd263aa-c8b5-4774-8d21-1daa0d0d9920" data-linktype="relative-path">RpcWritePrinter (section 3.1.4.9.3)</a></span>
zero or more times.</p>
</li><li><p><span><span> 
</span></span>call <span><a href="c4a17128-584d-402e-9bac-6a050e9da6d0" data-linktype="relative-path">RpcEndPagePrinter (section 3.1.4.9.4)</a></span>.</p>
</li></ul><p>The <span><a href="831cd729-be7c-451e-b729-bd8d84ce4d24#gt_59fb3ddc-63cf-45df-8a90-46a6af9e00cb" data-linktype="relative-path">print server</a></span> SHOULD
treat the calls to RpcStartPagePrinter and RpcEndPagePrinter as informational
only, with the only visible result being updating the page count of the print
job. The server MUST NOT make any assumptions or perform any validation steps
regarding the relative order or frequency of calls to these three methods.</p></div>