I'm working on a program in C# to pause and get the total page count when printing, here is main code:
string wql = "SELECT * FROM Win32_PrintJob";
ManagementObjectCollection mos;
Dictionary<uint,short> checkedJobs = new Dictionary<uint,short>();
while (true)
{
Thread.Sleep(SleepTime);
try
{
mos = new ManagementObjectSearcher(wql).Get();
if (mos != null && mos.Count > 0)
{
foreach (ManagementObject mo in mos)
{
if (mo != null)
{
uint jobId = ProcessJob(mo);
if (!checkedJobs.ContainsKey(jobId))
checkedJobs.Add(jobId, 0);
}
}
}
// ...
}
}
It works fine with normal task.But in N-Up printing ,when I print more than one slides in one page(N Slides-In-One Page), it comes wrong, I can not get the right total count to print.
Is there anyone who ever meet this question~please help,many thanks