Click here to Skip to main content
15,888,003 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hello every body.
Help me please.
How to use C# WinForm to monitor printer?
I should manipulate text files that are sent for printing.
Posted
Comments
Sinisa Hajnal 20-May-15 2:37am    
What have you tried? Did you do some research?

1 solution

Um...you probably can't, not in the way you mean. Text files aren't "sent" to the printer anymore: they are printed via a printer driver to a device dependant format (which includes images, fonts, and so forth and depends on the printer manufacturer) to a spooler which feeds these formatted files to the printer itself (again, via a manufacturer specific driver).

The text file itself only "exists" until the initial print driver conversion is completed.

And to monitor the printer itself requires knowledge of the specific printer - and probably assitance from the manufacturer.

You can monitor the printer spooler queue, if that helps: Monitor jobs in a printer queue (.NET)[^]
Or there is the API directly: https://msdn.microsoft.com/en-us/library/windows/desktop/dd162861(v=vs.85).aspx[^]
 
Share this answer
 
Comments
OriginalGriff 20-May-15 4:24am    
That's probably really, really not going to work - unless your app is starting the process that you are trying to get the information from.
If your app is doing that, then it's pretty easy for most console based applications (and horrific for windows based ones).

What exactly are you trying to achieve?

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