hi i’m trying to write ESC/POS Codes to a VKP80II printer, using the printer class form GHIE but it doesn’t seem to print when i send the data any ideas someone.
this is the code i’m using
static USBH_Printer printer;
static AutoResetEvent printerConnected = new AutoResetEvent(false);
public static void Main()
{
// Subscribe to USBH event.
USBHostController.DeviceConnectedEvent += DeviceConnectedEvent;
// wait for printer to be connectoed.
printerConnected.WaitOne();
// Get file to print
//byte[] buffer = Resources.GetBytes(Resources.BinaryResources.beep);
byte[] buffer = StrToByteArray("$0C");
// Printing can take a long time, give it a 5 seconds timeout here
printer.SendData(buffer, 0, buffer.Length, 5000);
// Sleep forever
Thread.Sleep(Timeout.Infinite);
}
yes mike this is the tutorial i used it works great, but when i use the printer protocol to print the symbols for the printer, it doesn’t seem to work i think is got something to do with my strtobyte function.
byte[] buffer = new byte[]{ 0x0C };
// Printing can take a long time, give it a 5 seconds timeout here
printer.SendData(buffer, 0, buffer.Length, 5000);