Click here to Skip to main content
15,895,799 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Until now i sended commands to printer, fullCut, WriteBytes, etc all of them has no return value.

now i need to receive a byte array with the status.


example:
send full cut to printer:
C#
public override bool SendCommandFullCut()
        {
            return this.SendCommandToPrinter(new byte[] { 0x1C, 0xC0, 0x34 });
        }


it is an hexadecimal code.

and, the check status is the same. i need to check if there is paper, or if is near to finish it.


Any help please?
thank you very much
Posted
Updated 2-Apr-20 5:00am

See http://msdn.microsoft.com/en-us/library/system.printing.printqueuestatus(v=vs.90).aspx or Google "c# get paper status from printer"
 
Share this answer
 
Comments
Member 4532951 3-Jul-14 8:35am    
Thats a possibility but not in my case, because I am looking for a byte array response. I found it. Anyway, thanks a lot!
Member 14790473 7-Apr-20 18:36pm    
Hello! I'm having this same issue, how do you solve it? which library are you using to send the commands to the printer?
I have to do this by the serial port.


You can "virtualize" a serial port using the USB port:

- connect with an adapter to de USB port
- install te drivers and select a new created virtualized serial port (in my case COM3)
- uninstall the printer in the control panel printer window (quit device)
- is very important to quit the printer because if not, the port is taken by the printer and when you're trying to open the port will be an error ("The given port name does not start with COM/com or does not resolve to a valid serial port")


try it. it works great.

http://msmvps.com/blogs/coad/archive/2005/03/23/SerialPort-_2800_RS_2D00_232-Serial-COM-Port_2900_-in-C_2300_-.NET.aspx[^]


PS. Thx to all!
 
Share this answer
 

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