因为需要做打印机方便的工作,了解了一下打印机状态码,原地址
https://msdn.microsoft.com/en-us/library/cc244854.aspx
表格左边是16进制的
如果用python以下代码
hPrinter = win32print.OpenPrinter (printer_name)
dic = win32print.GetPrinter(hPrinter,2)
得到的状态字段是10进制,比如如果结果中状态时1024,则换算成16进制是0x400,说明打印机正在打印
Printer status value/code |
Description |
---|---|
PRINTER_STATUS_BUSY 0x00000200 |
The printer is busy. |
PRINTER_STATUS_DOOR_OPEN 0x00400000 |
The printer door is open. |
PRINTER_STATUS_ERROR 0x00000002 |
The printer is in an error state. |
PRINTER_STATUS_INITIALIZING 0x00008000 |
The printer is initializing. |
PRINTER_STATUS_IO_ACTIVE 0x00000100 |
The printer is in an active input or output state. |
PRINTER_STATUS_MANUAL_FEED 0x00000020 |
The printer is in a manual feed state. |
PRINTER_STATUS_NOT_AVAILABLE 0x00001000 |
The printer is not available for printing. |
PRINTER_STATUS_NO_TONER 0x00040000 |
The printer is out of toner. |
PRINTER_STATUS_OFFLINE 0x00000080 |
The printer is offline. |
PRINTER_STATUS_OUTPUT_BIN_FULL 0x00000800 |
The printer's output bin is full. |
PRINTER_STATUS_OUT_OF_MEMORY 0x00200000 |
The printer has run out of memory. |
PRINTER_STATUS_PAGE_PUNT 0x00080000 |
The printer cannot print the current page. |
PRINTER_STATUS_PAPER_JAM 0x00000008 |
Paper is stuck in the printer. |
PRINTER_STATUS_PAPER_OUT 0x00000010 |
The printer is out of paper. |
PRINTER_STATUS_PAPER_PROBLEM 0x00000040 |
The printer has an unspecified paper problem. |
PRINTER_STATUS_PAUSED 0x00000001 |
The printer is paused. |
PRINTER_STATUS_PENDING_DELETION 0x00000004 |
The printer is being deleted as a result of a client's call to RpcDeletePrinter. No new jobs can be submitted on existing printer objects for that printer. |
PRINTER_STATUS_POWER_SAVE 0x01000000 |
The printer is in power-save mode.<182> |
PRINTER_STATUS_PRINTING 0x00000400 |
The printer is printing. |
PRINTER_STATUS_PROCESSING 0x00004000 |
The printer is processing a print job. |
PRINTER_STATUS_SERVER_OFFLINE 0x02000000 |
The printer is offline.<183> |
PRINTER_STATUS_SERVER_UNKNOWN 0x00800000 |
The printer status is unknown.<184> |
PRINTER_STATUS_TONER_LOW 0x00020000 |
The printer is low on toner. |
PRINTER_STATUS_USER_INTERVENTION 0x00100000 |
The printer has an error that requires the user to do something. |
PRINTER_STATUS_WAITING 0x00002000 |
The printer is waiting. |
PRINTER_STATUS_WARMING_UP 0x00010000 |
The printer is warming up. |