获得的页的总数量从Win32_PrintJob [英] Get the total amount of pages from Win32_PrintJob

查看:1190
本文介绍了获得的页的总数量从Win32_PrintJob的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

中PrintJob WMI类有很多的属性。 (参见: Win32_PrintJob MSDN上

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

我有两极的打印作业和显示作业的信息一小.NET应用程序。

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

总页数属性格式给出的页面发送量。但这个数字并没有考虑到用户请求的份数。因此,如果用户想打印5份两页的文件,总页数的值将是2,而不是10。

The TotalPages propery gives the amount of pages sent. But that figure DOESN'T take into account the number of copies requested by the user. So, if a user wants to print 5 copies of a two page document, the value of TotalPages will be 2, not 10.

我怎样才能副本用于印刷作业的数量,或得到的页的总金额将被打印(次拷贝页中的作业号数)?

How can i get the number of copies for a printing job, or get the total amount of pages to be printed (number of copies times number of pages in the job)?

感谢

推荐答案

我有同样的问题,Win32_PrintJob(总页数/ PagesPrinted没有考虑到副本的帐号)。我通过WMI与Win API相结合的解决了这个问题。

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.

从的 DEVMODE 的结构(dmCopies),这是 JOB_INFO_2 结构。

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

所以,你叫GetJob与级别= 2,你会得到JOB_INFO_2实例。从那里,这是小菜一碟,编组只是点点:)

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 :).

希望这有助于。

干杯,

卢卡斯

这篇关于获得的页的总数量从Win32_PrintJob的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆