Direct printing on the door

1

I need a VB.Net code to print directly to the port of a bead printer without using any Windows driver .

I add that my printer is connected by USB but in the future I needed it to print on any type of port: COM, Parallel, USB ...

    
asked by anonymous 09.05.2014 / 10:23

1 answer

4

I can not say exactly to your printer because I do not know it, but essentially you have to write directly to the port, usually PRN or LPT1 or COM1 .

By sending directly to the port you avoid going through the Windows print manager.

Simplified example (does not have the quality that a production code should have):

Dim impressora = new System.IO.StreamWriter(@"\.\COM1");
impressora.Write("Teste");
impressora.Flush();
impressora.Close();

If the USB printer may be available configured as a COM1 for example, this will work as well.

If I have to write to the same USB, I would not know exactly what to do. Some tips:

  • Use the LibUSBdotNet library that is a binding for LibUSB .

  • Use bindings for Win32 and build a library that writes to USB at the lowest level that Windows allows.

I placed it on GitHub for future reference .

    
09.05.2014 / 10:55