Question

Do anyone know anything about libraries or similiar to use for sending images to a thermal printer (ESC/POS)? I've been working on a solution for it, for long time but I can't seem to solve it. I found alot of info about this on the intertube but it seems to only exist for printers that are non-ip ones.

Anyone on stack that sits on valuable info?

Was it helpful?

Solution 2

Printers can be a pain...

Assuming that you use a industrial printer my guess is that there is no standard library. Most industrial printer manufacturers did implement their own protocol. However, this protocol is most of the times quite basic.

The manual that comes with the printer should give you a clue on how to use it.

In general a tcp connection to the printer with the standard TcpClient does the job. See http://msdn.microsoft.com/en-us/library/system.net.sockets.tcpclient(v=vs.110).aspx

OTHER TIPS

Recently found 2 libraries:

[1] ThermalDotNet: Open source library is written in Mono C#. It does support images. https://github.com/yukimizake/ThermalDotNet

Sample: https://electronicfields.wordpress.com/2011/09/29/thermal-printer-dot-net/

static void TestImage(ThermalPrinter printer)
    {
        printer.WriteLine("Test image:");
        Bitmap img = new Bitmap("../../../mono-logo.png");
        printer.LineFeed();
        printer.PrintImage(img);
        printer.LineFeed();
        printer.WriteLine("Image OK");
    }

[2] printer utility: closed source, NuGet package is available. It does support images. https://www.nuget.org/packages/PrinterUtility/

Sample on youtube: https://www.youtube.com/watch?v=0mC_yvT3abw

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top