Get the total amount of pages from Win32_PrintJob

前端 未结 1 657
难免孤独
难免孤独 2021-01-03 14:31

The Win32_PrintJob WMI class has lots of properties. (see: Win32_PrintJob on MSDN)

I have a small .NET application that poles the printing jobs and displays the jobs

相关标签:
1条回答
  • 2021-01-03 14:51

    i had the same problem with Win32_PrintJob (TotalPages/PagesPrinted doesn't take into account number of copies). I solved it by combining WMI with Win api.

    Number of copies can be retrieved from DEVMODE structure (dmCopies) which is part of JOB_INFO_2 structure.

    So you call GetJob with Level=2 and you will get JOB_INFO_2 instance. From there, it's piece of cake, just little bit of marshaling :).

    Hope this helps.

    Cheers,

    Lukas

    0 讨论(0)
提交回复
热议问题