2
Answers

Unable to get number of copies of a print job in C#

Ali Sahi

Ali Sahi

8y
407
1
I am creating a custom print job monitoring application in C# Win Forms, I am able to get most the print job information using PrintJobInfoColletion but I am not able to get number of copies here is my code so far:
  1. PrintJobInfoCollection jobs = pq.GetPrintJobInfoCollection();  
  2.         foreach (PrintSystemJobInfo job in jobs)  
  3.         {  
  4.   
  5.             string[] row = new string[] { job.JobIdentifier.ToString(),  
  6.                                           pq.Name,  
  7.                                           job.Name,  
  8.                                           job.JobStatus.ToString(),  
  9.                                           job.Submitter,  
  10.                                           job.NumberOfPages.ToString(),  
  11.                                           ((job.JobSize / 1024f) / 1024f).ToString("N2") + " MB",  
  12.                                           job.TimeJobSubmitted.ToLocalTime().ToString() };  
  13.             dataGridView1.Rows.Add(row);                   
  14.         } 

While I tried this code to get a number of copies which is always returning me 1

  1. var copies =  job.HostingPrintQueue.CurrentJobSettings.CurrentPrintTicket.CopyCount; 
 
Answers (2)