I have been trying to get the status of a print job using win32print in Python.
The status codes provided by win32print don\'t seem to match the status code for the
You can start here:
This script allows you to see your printing job queue. You can customize it using the Get Job documentation if you want to see the information of a specific Job.
import time
import win32print
#----------------------------------------------------------------------
def print_job_checker():
"""
Prints out all jobs in the print queue every 5 seconds
"""
jobs = [1]
while jobs:
jobs = []
for p in win32print.EnumPrinters(win32print.PRINTER_ENUM_LOCAL,
None, 1):
flags, desc, name, comment = p
phandle = win32print.OpenPrinter(name)
print_jobs = win32print.EnumJobs(phandle, 0, -1, 1)
if print_jobs:
jobs.extend(list(print_jobs))
for job in print_jobs:
print "printer name => " + name
document = job["pDocument"]
print "Document name => " + document
win32print.ClosePrinter(phandle)
time.sleep(5)
print "No more jobs!"
#----------------------------------------------------------------------
if __name__ == "__main__":
print_job_checker()
Script taken from this post
The returned status is a bit mask, as described here , for example . Multiple values can be OR'ed, so your value of 8208(hex 0x00002010) indicates that the printer has (all) status.