Click here to Skip to main content
15,886,689 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can i get Total Pages Jammed,Model ,Black Supply(Available) ,serial number ,etc from usb connected printer to my c# app? I am trying to fetch these details by using Windows Spooler but i am not getting these details. Can anyone plz tell me how can i retrieve printer's details?
Posted
Comments
[no name] 10-Aug-12 10:20am    
"Windows Spooler but i am not getting these details "... of course not. I would be surprised if you were.

The main problem with your question is I dont think we can answer it. Printers have some default settings that can be set via the .NET assembelies:
http://msdn.microsoft.com/en-us/library/5ekk3hse[^]

Your printer my store additional properties not required by the default printer class, and if you are going to get these then you will have to look in the printer documentation for the individual product.
 
Share this answer
 
Comments
StianSandberg 10-Aug-12 10:25am    
5'd
There is no vendor-independent approach, especially for direct attached printers. As there is no standard and/or interface the driver must comply in this matter. Every vendor will use it's own dll-s, own methods to signal such conditions to the user (if at all).
For network printers the only not vendor-specific approach of monitoring them is using SNMP if the device supports it. Consult this article: http://techblog.willshouse.com/2012/01/24/how-to-monitor-canon-printers-with-snmp/[^]. And only network printers will have an embedded web server, that can be also used to retrieve this kind of information. But USB printers do not have this either.

Update: there is something you could follow. The PRINTER_INFO_2 structure contains a status field that is near of what you want. You need to call out to unmanaged api.
Read these:
http://social.msdn.microsoft.com/Forums/en/vcgeneral/thread/38280210-406a-4e4e-8d31-f044a59708e2[^]
Changing printer settings using C#[^]
Printers and SafeHandles[^]
 
Share this answer
 
v3

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