ESCPOS_NET.SkiaSharp 4.0.2

dotnet add package ESCPOS_NET.SkiaSharp --version 4.0.2
                    
NuGet\Install-Package ESCPOS_NET.SkiaSharp -Version 4.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ESCPOS_NET.SkiaSharp" Version="4.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ESCPOS_NET.SkiaSharp" Version="4.0.2" />
                    
Directory.Packages.props
<PackageReference Include="ESCPOS_NET.SkiaSharp" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ESCPOS_NET.SkiaSharp --version 4.0.2
                    
#r "nuget: ESCPOS_NET.SkiaSharp, 4.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ESCPOS_NET.SkiaSharp@4.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ESCPOS_NET.SkiaSharp&version=4.0.2
                    
Install as a Cake Addin
#tool nuget:?package=ESCPOS_NET.SkiaSharp&version=4.0.2
                    
Install as a Cake Tool

ESCPOS_NET.SkiaSharp

This is a fork of ESCPOS_NET by Luke Paireepinart and contributors. All credit for the library goes to the original project. This fork only replaces the image-processing dependency. Original package: ESCPOS_NET on NuGet · Original documentation: github.com/lukevp/ESC-POS-.NET

ESCPOS_NET is an easy to use, cross-platform .NET Standard 2.0 library for the ESC/POS protocol used by thermal receipt printers, line displays and cash drawers. It works with Serial, USB, Ethernet, WiFi and Bluetooth printers.

Why this fork?

ESCPOS_NET 3.0.0 (the latest upstream release) depends on SixLabors.ImageSharp 2.1.3, which has several known security vulnerabilities. Upgrading ImageSharp is not an option for many projects:

  • Pinning ImageSharp 3.x breaks image printing: ESCPOS_NET is compiled against 2.x and PrintImage throws MissingMethodException (Image.Load(Byte[])).
  • ImageSharp 3.x uses the Six Labors Split License instead of Apache 2.0 and no longer supports .NET Standard 2.0.

This fork replaces ImageSharp with SkiaSharp (MIT). Everything else is the upstream code.

ESCPOS_NET 3.0.0 ESCPOS_NET.SkiaSharp
Image library SixLabors.ImageSharp 2.1.3 SkiaSharp ≥ 3.116.1
Licenses MIT + Apache 2.0 MIT
Namespace / assembly ESCPOS_NET ESCPOS_NET (unchanged)

Installation

dotnet add package ESCPOS_NET.SkiaSharp

It is a drop-in replacement: namespaces, assembly name and APIs are the same, so you only swap the package reference. Remove ESCPOS_NET when you add this package. Referencing both causes duplicate type conflicts.

Quick start

using ESCPOS_NET;
using ESCPOS_NET.Emitters;
using ESCPOS_NET.Utilities;

var printer = new ImmediateNetworkPrinter(new ImmediateNetworkPrinterSettings
{
    ConnectionString = "192.168.1.50:9100",
    PrinterName = "TestPrinter",
});

var e = new EPSON();
await printer.WriteAsync(
    ByteSplicer.Combine(
        e.CenterAlign(),
        e.PrintImage(File.ReadAllBytes("logo.png"), isHiDPI: true, maxWidth: 384),
        e.PrintLine("Thank you!"),
        e.FullCut()));

See the original documentation for printers, status events, encodings, barcodes and everything else.

Image printing

PrintImage / BufferImage accept encoded image bytes (PNG, JPEG, BMP, GIF, WebP, ...). The image is scaled to maxWidth (aspect ratio preserved), transparent areas become white, and it is converted to black and white with Stucki dithering, the same pipeline as upstream.

The 1-bit conversion is also available directly:

using ESCPOS_NET.Extensions;

SingleBitImage img = ImageRasterizer.ToSingleBitImage(pngBytes, maxWidth: 384, threshold: 0.5f);
// img.Width, img.Height, img.Data (1 bit per pixel, MSB first, rows padded to whole bytes)

Platforms

SkiaSharp uses a native library. This package brings everything needed:

  • Windows (x86, x64, arm64) and macOS (Intel and Apple Silicon): included with SkiaSharp.
  • Linux (glibc and musl/Alpine; x64, arm, arm64): included through SkiaSharp.NativeAssets.Linux.NoDependencies, which needs no fontconfig, so it works in slim containers.

If your application also references SkiaSharp.NativeAssets.Linux (for example through Avalonia), make sure its version matches the resolved SkiaSharp version. Otherwise SkiaSharp fails at startup on Linux with "The version of the native libSkiaSharp library is incompatible".

Breaking changes compared to ESCPOS_NET 3.0.0

  • The public SixLabors.ImageSharp.ImageSharpExtensions.ToSingleBitPixelByteArray extension was removed. Use ESCPOS_NET.Extensions.ImageRasterizer.ToSingleBitImage instead.
  • Printed images may differ in individual dots from ImageSharp's output (same size and tone, slightly different dither pattern).

License and credits

MIT, the same as the original project. Copyright (c) 2019 Luke Paireepinart, (c) 2022 CandL Development, LLC, with SkiaSharp changes (c) 2026 Valentin Huber.

The library itself is the work of the ESCPOS_NET contributors. Please report issues with the image printing in this fork and everything else in the original project.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on ESCPOS_NET.SkiaSharp:

Package Downloads
CaysnPrintServer

Reliable CAYSN thermal printer server with job queuing, print confirmation, connection pooling, and SignalR notifications.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.2 164 10/12/2026

- Replaced SixLabors.ImageSharp with SkiaSharp (removes vulnerable ImageSharp 2.1.3 dependency).
- Breaking: removed public SixLabors.ImageSharp.ImageSharpExtensions; use ESCPOS_NET.Extensions.ImageRasterizer instead.