RequestPrinterStatus

Renderização e impressão

Descrição

Use esta função para ativar um sistema de impressão alternativo que permite retornar o status da impressora Muitos dos códigos de status retornados vêm do driver da impressora; não há garantia de que os valores contenham informação significativa para todas as impressoras

O primeiro passo é chamar esta função com StatusCommand=101 para habilitar o monitoramento do status da impressora Opcionalmente, o job de impressão pode ser iniciado em estado pausado chamando esta função novamente com StatusCommand=103 Isso pode ser necessário para jobs pequenos, que de outro modo terminariam antes que o status pudesse ser lido

O job de impressão pode então ser iniciado como de costume com uma das funções de impressão: PrintDocument, PrintDocumentToFile ou

PrintDocumentToPrinterObject.

Uma vez iniciado o job de impressão, esta função pode ser chamada repetidamente para obter o status da impressora do job ao longo do tempo Se o job foi iniciado em estado pausado, a impressão de fato só começa quando esta função for chamada com StatusCommand=402

Sintaxe

Delphi

Function TPDFlib.RequestPrinterStatus(StatusCommand: Integer): Integer;

ActiveX

Function PDFlib::RequestPrinterStatus(StatusCommand As Long) As Long

DLL

int DLRequestPrinterStatus(int InstanceID, int StatusCommand);

Parâmetros

StatusCommand100 = Turn off printer status monitoring. 101 = Turn on printer status monitoring. 102 = Returns 1 if printer status monitoring is active. 103 = Start print job in paused state. 104 = Start printing immediately. 105 = Returns 1 if print job will be started in paused state. 200 = Returns 1 if print job data exists. 201 = Returns the Windows Spooler JobID. 202 = Returns the job priority, from 1 to 99. 203 = Returns the job's position in the print queue. 204 = Returns the total page count. 205 = Returns the number of pages that have been printed. This is usually zero if the data type is "RAW". 206 = Returns the number of milliseconds since the print job was started. 207 = Returns the print job data type Returns 1 if the data type contains "RAW" Returns 2 if the data type contains "EMF" Returns 3 if the data type contains "TEXT" Returns 4 if the data type contains "XPS" 300 = Returns the encoded job status. 301 = Returns 1 if the job is paused. 302 = Returns 1 if there is an error. 303 = Returns 1 if the job is being deleted. 304 = Returns 1 if the job is spooling. 305 = Returns 1 if the job is printing. 306 = Returns 1 if the printer is offline. 307 = Returns 1 if the printer is out of paper. 308 = Returns 1 if the job has printed. 309 = Returns 1 if the job has been deleted. 310 = Returns 1 if the driver cannot print the print job. 311 = Returns 1 if the printer has an error that requires the user to do something. 312 = Returns 1 if the job has been restarted. 313 = For Windows XP and later, returns 1 if the job has been sent to the printer (job may not be printed yet). 314 = For Windows Vista and later, returns 1 if the job has been retained in the print queue and cannot be deleted. 401 = Pause the print job. 402 = Resume a paused print job. 403 = Delete the print job.