Reading data from USB Printer in C#
I have a CUSTOM PLUS II USB printer that I need to send and receive status information.
I am able to send commands to the printer using the WritePrinter method using winspool but can't read the response. I can't find a single working example of the ReadPrinter metho开发者_如何转开发d.
This is the main example I have used for writing data: http://support.microsoft.com/kb/322091
I have tried to contact CUSTOM but get no response from them. Any other way to read from a USB printer would also be helpful.
It is called Bidi Communication. The SDK topic starts here. Beware for the rough ride, this is not friendly. Especially not in C#, these are COM interfaces without a type library.
DataCard makes a c# wrapper for the IBidiSpl Interface, available in their SDK, which I found in SD260 printer support. The "Status" folder contains code to get bidirectional status data from a printer using the windows bidi API.
精彩评论