Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# USB Printer
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 10-Aug-12 1:49am
Comments
Wes Aday at 10-Aug-12 10:20am
   
"Windows Spooler but i am not getting these details "... of course not. I would be surprised if you were.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
Comments
AlluvialDeposit at 10-Aug-12 10:25am
   
5'd
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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[^]
  Permalink  
v3

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 555
1 Kornfeld Eliyahu Peter 409
2 Maciej Los 359
3 DamithSL 196
4 OriginalGriff 188
0 OriginalGriff 6,353
1 DamithSL 4,854
2 Maciej Los 4,466
3 Kornfeld Eliyahu Peter 4,058
4 Sergey Alexandrovich Kryukov 3,897


Advertise | Privacy | Mobile
Web03 | 2.8.141220.1 | Last Updated 10 Aug 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100