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
<PackageReference Include="ESCPOS_NET.SkiaSharp" Version="4.0.2" />
<PackageVersion Include="ESCPOS_NET.SkiaSharp" Version="4.0.2" />
<PackageReference Include="ESCPOS_NET.SkiaSharp" />
paket add ESCPOS_NET.SkiaSharp --version 4.0.2
#r "nuget: ESCPOS_NET.SkiaSharp, 4.0.2"
#:package ESCPOS_NET.SkiaSharp@4.0.2
#addin nuget:?package=ESCPOS_NET.SkiaSharp&version=4.0.2
#tool nuget:?package=ESCPOS_NET.SkiaSharp&version=4.0.2
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
PrintImagethrowsMissingMethodException(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.ToSingleBitPixelByteArrayextension was removed. UseESCPOS_NET.Extensions.ImageRasterizer.ToSingleBitImageinstead. - 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 | Versions 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. |
-
.NETStandard 2.0
- Microsoft.Extensions.Logging (>= 6.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 6.0.1)
- SkiaSharp (>= 3.116.1)
- SkiaSharp.NativeAssets.Linux.NoDependencies (>= 3.116.1)
- SuperSimpleTcp (>= 2.4.0)
- System.IO.Ports (>= 6.0.0)
- System.Text.Json (>= 6.0.4)
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.