Click here to Skip to main content
11,705,451 members (59,715 online)
Rate this: bad
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 0:49am
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
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:[^]

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.
AlluvialDeposit at 10-Aug-12 10:25am
Rate this: bad
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:[^]. 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:[^]
Changing printer settings using C#[^]
Printers and SafeHandles[^]

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 500
1 OriginalGriff 269
2 CPallini 82
3 ppolymorphe 68
4 Inimicos 60
0 OriginalGriff 9,053
1 Sergey Alexandrovich Kryukov 8,347
2 CPallini 5,189
3 Maciej Los 4,726
4 Mika Wendelius 3,626

Advertise | Privacy | Mobile
Web02 | 2.8.150819.1 | Last Updated 10 Aug 2012
Copyright © CodeProject, 1999-2015
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