pythonprintingspooler

I would like to delete/clear the print queue using python


I am doing some tests on a local printer. I can print to it and get its status using python module win32print but I can't figure out how to delete a queued job?

Thanks


Solution

  • You can use SetJob to set the status of a job to cancelled. You will need to do this for all active print jobs. There isn't a method to remove all jobs.

    http://timgolden.me.uk/pywin32-docs/win32print__SetJob_meth.html