Click here to Skip to main content
15,887,776 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
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-
Posted
Updated 2-Jan-11 9:51am
v4
Comments
Sergey Alexandrovich Kryukov 2-Jan-11 14:14pm    
Imagine that good percentage of the question would have a title "please help" (some do)?
How would anyone select such a question as the one in her or his field of expertize?!
Emilio Garavaglia 2-Jan-11 14:47pm    
That's a too general question. Provide some more detail about the environment of such program: which libraries are you using? What are "documents" in that program ?

1 solution

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
 
Share this answer
 
Comments
a.mamdouh 6-Jan-11 19:48pm    
thank u alot Espen, i really appreciate your valuable help, i will give it a try and 4 sure i will let everyone know if it succeed

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900