获得的页的总数量从Win32

编程入门 行业动态 更新时间:2024-10-20 20:47:39
本文介绍了获得的页的总数量从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

本文发布于:2023-11-06 06:43:56,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1562969.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:数量

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!