Posrender 0.1.0
dotnet add package Posrender --version 0.1.0
NuGet\Install-Package Posrender -Version 0.1.0
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="Posrender" Version="0.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Posrender" Version="0.1.0" />
<PackageReference Include="Posrender" />
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 Posrender --version 0.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Posrender, 0.1.0"
#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 Posrender@0.1.0
#: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=Posrender&version=0.1.0
#tool nuget:?package=Posrender&version=0.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Posrender
A .NET library that parses an ESC/POS byte stream and renders it as a PNG image, reproducing what an Epson label printer would physically print. Useful for generating label previews in applications that drive POS printers.
Installation
dotnet add package Posrender
Usage
using Posrender;
byte[] escPosData = /* raw ESC/POS command stream */;
// Render with default options (80 mm Epson printer, 203 DPI)
Stream png = PosRenderer.Render(escPosData);
// Render with custom paper width
var options = PosRenderOptions.FromMillimeters(58);
Stream png = PosRenderer.Render(escPosData, options);
// Write to file
using var file = File.Create("label.png");
png.CopyTo(file);
Options
| Property | Default | Description |
|---|---|---|
PaperWidthDots |
576 | Paper width in dots (≈ 72 mm printable area at 203 DPI) |
Dpi |
203 | Printer resolution |
Use PosRenderOptions.FromMillimeters(widthMm, dpi) to compute the dot width from physical dimensions.
Supported ESC/POS commands
| Command | Description |
|---|---|
ESC @ |
Initialize printer |
ESC a n |
Text alignment (left / center / right) |
ESC E n |
Bold on/off |
ESC - n |
Underline (none / single / double) |
ESC ! n |
Print mode (bold, double-height, double-width, underline) |
ESC M n |
Font select (A / B) |
ESC d n |
Feed n lines |
GS ! n |
Character size (width × height multiplier) |
GS v 0 |
Print raster image |
GS ( k |
QR code (rendered as a placeholder rectangle) |
GS V |
Paper cut (ignored) |
| Printable bytes | Text output |
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- SixLabors.ImageSharp (>= 3.1.12)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0 | 114 | 3/24/2026 |