ESCPOS 1.2.1

A .NET Standard 2.0 ESC/POS Printer Commands Helper

Install-Package ESCPOS -Version 1.2.1
dotnet add package ESCPOS --version 1.2.1
<PackageReference Include="ESCPOS" Version="1.2.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ESCPOS --version 1.2.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

SourceLink
Build Status
GitHub code size in bytes
NuGet
GitHub
FOSSA Status

ESCPOS

A ESC/POS Printer Commands Helper.

Installing via NuGet Package

The NuGet Package can be found here and you can install it with:

PM> Install-Package ESCPOS

Usage

All command methods will return a byte array that you should concatenate with the bytes of your data, and then send it all to your printer.

The Print extension method will send a byte array to the informed printer address, which can be something like COM3, LPT1, \\127.0.0.1\printer, 192.168.0.100:9100, etc. or even a path to a text file like ./print.txt.

There is also an Add and ToBytes extension methods located in the namespace ESCPOS.Utils.
The first one for byte arrays, you can use it to concatenate 2 or more byte arrays just like this:

byte[] result = array1.Add(array2, array3, ..., arrayN);

There's also an overload to accept string parameters instead of byte arrays. It appends all strings into one new string and then converts it to a byte array.
And an overload to accept the mix of byte arrays and strings parameters, since it's accepting object type parameters, this will ignore any parameter that is not one of them (e.g. int).

The second for strings, you can use it to convert a UTF-8 string to a byte array:

byte[] result = "Some string".ToBytes();

Examples

All examples will assume the using statements below:

using static ESCPOS.Commands;
using ESCPOS;
using ESCPOS.Utils;

QRCode

byte[] qrCodeCommand = PrintQRCode("Some data");
qrCodeCommand.Print("COM2");

Barcode

byte[] barCodeCommand = PrintBarCode(BarCodeType.EAN13, "9780201379624");
barCodeCommand.Print("192.168.0.100:9100");

Considerations

This library will only accept UTF8 Encoding for Barcodes and QRCodes data.

When printing CODE128 barcodes, it will use automatically subset B, which supports numbers, upper and lower case letters and some additional characters.

You can see the changelog here.

License

FOSSA Status

SourceLink
Build Status
GitHub code size in bytes
NuGet
GitHub
FOSSA Status

ESCPOS

A ESC/POS Printer Commands Helper.

Installing via NuGet Package

The NuGet Package can be found here and you can install it with:

PM> Install-Package ESCPOS

Usage

All command methods will return a byte array that you should concatenate with the bytes of your data, and then send it all to your printer.

The Print extension method will send a byte array to the informed printer address, which can be something like COM3, LPT1, \\127.0.0.1\printer, 192.168.0.100:9100, etc. or even a path to a text file like ./print.txt.

There is also an Add and ToBytes extension methods located in the namespace ESCPOS.Utils.
The first one for byte arrays, you can use it to concatenate 2 or more byte arrays just like this:

byte[] result = array1.Add(array2, array3, ..., arrayN);

There's also an overload to accept string parameters instead of byte arrays. It appends all strings into one new string and then converts it to a byte array.
And an overload to accept the mix of byte arrays and strings parameters, since it's accepting object type parameters, this will ignore any parameter that is not one of them (e.g. int).

The second for strings, you can use it to convert a UTF-8 string to a byte array:

byte[] result = "Some string".ToBytes();

Examples

All examples will assume the using statements below:

using static ESCPOS.Commands;
using ESCPOS;
using ESCPOS.Utils;

QRCode

byte[] qrCodeCommand = PrintQRCode("Some data");
qrCodeCommand.Print("COM2");

Barcode

byte[] barCodeCommand = PrintBarCode(BarCodeType.EAN13, "9780201379624");
barCodeCommand.Print("192.168.0.100:9100");

Considerations

This library will only accept UTF8 Encoding for Barcodes and QRCodes data.

When printing CODE128 barcodes, it will use automatically subset B, which supports numbers, upper and lower case letters and some additional characters.

You can see the changelog here.

License

FOSSA Status

  • .NETStandard 2.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.2.1 227 9/15/2020
1.2.0 358 3/18/2020
1.1.2 305 1/7/2020
1.1.1 206 12/19/2019
1.1.0 480 8/28/2019
1.0.3 158 8/27/2019
1.0.2 156 8/27/2019
1.0.1 159 8/27/2019
1.0.0 160 8/26/2019