Direct printing on the door

Asked

Viewed 1,677 times

1

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

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

  • Do you have any answers that have helped you? Is there anything I can change in my response to better suit your need?

1 answer

4

I can’t tell exactly to your printer because I don’t know you but essentially you need to write directly to the door, normally PRN or LPT1 or COM1.

Sending directly to the port avoids going through the Windows print manager.

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

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

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

If I have to write to USB myself, I wouldn’t know exactly what to do. A few tips:

  • Use the library Libusbdotnet which is a Binding for Libusb.

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

I put in the Github for future reference.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.