I am looking for a way to get a list or number of jobs from a specific printer. At best, I would like to have a “job object” that represents one print job and its name in the print queue. A.
This is necessary because I need to monitor the status of the printer so that I can replenish the print queue with a new batch of documents without overflowing the print queue manager
Thanks in advance!
Edit: added solution code snippet
private int GetNumberOfPrintJobs() { LocalPrintServer server = new LocalPrintServer(); PrintQueueCollection queueCollection = server.GetPrintQueues(); PrintQueue printQueue = null; foreach (PrintQueue pq in queueCollection) { if (pq.FullName == PrinterName) printQueue = pq; } int numberOfJobs = 0; if (printQueue != null) numberOfJobs = printQueue.NumberOfJobs; return numberOfJobs; }
Berry ligtermoet
source share