Bill printing jobs


I'm looking for a way to hook up all printing jobs on a machine.

We have some Kiosk computers running windows XP, and we would like to allow customers to print. We would like to be able to catch the printing job, as it is sent to the printer, analyze it, show the user a dialog with the price for the printing and if he approves - send the job to the printer.

If he doesn't approve, the job must be canceled.

My first idea was to use a hook. But is there a hook for printing jobs? How is it used?

Someone also mentioned PCL (Printer Command Language), meaning us to write a wrapper for the local printer driver. How difficult is that? Where can i find a good tutorial for PCL?

What about PJL (Printer job language)?

The target language is c++.

Your input will be appreciated.

Thanks, Summerbulb


You can use WMI to get notified about new printer jobs using Win32_PrintJob.

As soon as the job is created, call Pause on it to suspend, show your GUI. If the client accepts the job, call Resume to actually print the file.

See Example: Receiving Event Notifications Through WMI for a C++ example which handles WMI notifications.

This video can help you solving your question :)
By: admin