计算要打印的页数 [英] Calculating the numer of pages to be printed

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

问题描述

大家好,

我有一个程序可以收集有关PC普通用户将尝试打印的所有文档的信息,这些信息已存储在计算机中,例如pdf文件,word doc,图片...等

该程序也是使用C#和Java编写的.

该程序将在winXP或win7操作系统上使用.

但是问题在于,在实际打印之前要知道该人打算打印的页数.我成功地知道了页数,但不幸的是,只有在打印机开始打印后,这才没用.


==更多说明==

一开始,我尝试使用Windows系统中已经存在的C#中的printerJob类,该类存储打印文件的临时信息,该信息出现在PC的打印机队列中,但是该方法对我不起作用,因为一旦打印机接受任何打印命令,它就会立即开始打印,而我无法停止它.

我需要
1-具有停止任何类型的任何文档文件或图片的任何打印过程的能力,随时可以打印.

AND

2-知道用户尝试打印的纸张数量.

我虽然说如果我使用打印机挂钩,就可以实现这个目标,但是我对该主题没有足够的了解


谢谢

标题已更改
-Emilio-

Hi everyone,

I have a program that collects some information about any documents that the regular user of the PC will try to print which is stored already in the computer e.x pdf file, word doc, picture...etc

The program was written using C# and java too.

The program will be used on winXP or win7 operating systems

But the problem was in the part of knowing the number of pages that the person intended to print before actually printing them. I succeed to know the number of pages but unfortunately only after the printer starts printing them, and this was unuseful.


==more explaination==

At the begining i tried to use the printerJob class in C# that is already exists in the windows system which stores temporary information of the printing file, which appears in the printer queue of the pc, but this method didn''t worke with me because the as soon as the printer takes any printing order it start to print immediately and i can not stop it.

I need to
1- Have the ability to stop any printing process of any type of any document file or picture will be printed at any time.

AND

2- know the number of papers the user is trying to print.

i though that if i used printer hook i will be able to acheive this goal but i do not have enough knowledge about that topic


Thanks

Title changed
-Emilio-

推荐答案

看看这个项目: PDFCreator [ ^ ].

或这样: EmfPrinter [ Windows设备驱动程序工具包 [ ^ ].如果创建虚拟打印机驱动程序,则将具有完全控制权,并且确切知道用​​户将发送给打印机的内容.

问候
Espen Harlinn
Take a look at this project: PDFCreator[^].

or this: EmfPrinter[^]

Probably a serious amount of work, but it should get you there ...

From your description I can''t see any really simple and robust solution.

You''ll find source code for a printer device driver as a part of the Windows Device Driver Kit[^]. If you create a virtual printer driver, you will have full control and know exactly what your users are sending to the printer.

Regards
Espen Harlinn


这篇关于计算要打印的页数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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