How to determine specific printer properties for a printer job?
<p>I am working on some code that monitors the printer queue and then uses the event information to collect some specifics about the job, including # pages, orientation, whether or not it was color and how many copies were requested.</p>

<p>I catch the events using the code from Merrion Computing (which is now open source); which handles the interop.</p>

<p>In the case of Color, it is supposed to be stored in JOB_INFO_2.pDeviceMode.dmColor; however no matter how I submit the job (color or black and white using the printer properties printing from several apps, including word and adobe) it always indicates color.  I debugged through that code directly, and the interop appears to be correct, so then I used the JobId from the event to query the print system via .NET with the code (below); and it contains exactly the same settings for copies and color.</p>

<pre><code>int iJobId = e.PrintJob.JobId;

LocalPrintServer printServer = new LocalPrintServer();
PrintQueueCollection queueCollection = printServer.GetPrintQueues();
foreach (PrintQueue queue in queueCollection)
{
queue.Refresh();
if(queue.FullName.Equals(e.PrintJob.PrinterName,StringComparison.OrdinalIgnoreCase))
{
  int? iPageCount;

  PrintJobInfoCollection jobs = queue.GetPrintJobInfoCollection();
  foreach(PrintSystemJobInfo job in jobs)
  {
    job.Refresh();
    if(job.JobIdentifier==iJobId)
    {
      iPageCount = job.NumberOfPages;
    }
  }

  //-- Found the Printer...
  int? iCopyCount=queue.CurrentJobSettings.CurrentPrintTicket.CopyCount;
  PageOrientation? eOrientation = queue.CurrentJobSettings.CurrentPrintTicket.PageOrientation;
  OutputColor? eColor = queue.CurrentJobSettings.CurrentPrintTicket.OutputColor;

  Debug.WriteLine("queue=" + queue.FullName + ", Copies=" + iCopyCount.Value + ",Color=" + eColor.ToString() + ", pagecount=" + "unk" /*iPageCount.Value*/ + ", Orientation=", eOrientation.ToString());
  Debug.WriteLine("---");
}
}
</code></pre>

<p>Has anyone seen a reliable way to retrieve the number of copies and page count (preferably using .NET) for a specific printer job?
I </p>

<p>I did find this post describing the same type of problem, but there wasn't a resolution there.</p>

<p><a href="https://stackoverflow.com/questions/15454360/determine-current-print-job-color-using-c-sharp/36673427#36673427">Determine current print job color using C#</a></p>

<p>It should also be noted that the WMI Code from the above article also returns color.</p>

<p>I went in an enabled the eventlog for printing (<a href="http://www.papercut.com/kb/Main/LogPrintJobsInEventViewer" rel="nofollow noreferrer">http://www.papercut.com/kb/Main/LogPrintJobsInEventViewer</a>).  Looking at the details of the print event; the color setting is as expected "2", which indicates grayscale.</p>

<p>It is pretty clear that the windows subsystem is receiving the requested setting; however I have been unsuccessful to retrieve the value using WMI, System.Printing's namespace, or the interop from Merrion's print monitoring library where the values all indicate that the job is color with the correct number of pages and copies.</p>