DemoPOS 0.0.2

dotnet add package DemoPOS --version 0.0.2                
NuGet\Install-Package DemoPOS -Version 0.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="DemoPOS" Version="0.0.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DemoPOS --version 0.0.2                
#r "nuget: DemoPOS, 0.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.
// Install DemoPOS as a Cake Addin
#addin nuget:?package=DemoPOS&version=0.0.2

// Install DemoPOS as a Cake Tool
#tool nuget:?package=DemoPOS&version=0.0.2                

DemoPOS

DemoPOS is a simple and lightweight fluent wrapper around RawPrint and ESCPOS to allow for simple and direct printing to a thermal printer installed on a windows machine (Such as an Epson TM-T88IV for example).

The usage is quite straightforward:

To get a list of names of installed printers on the machine, use the RegistryHelper class:

var printers = RegistryHelper.GetInstalledPrinterNames();

Then, create a new DocumentManager with the desired ESC/POS Printer of your choice:

var manager = new DocumentManager(PrinterName);

You can then chain various commands via a fluent style api, such as:

manager.AddTitle("Hello World")
    .AddLine("This is a test print")
    .AddLine("On a thermal printer.")
    .AddQrCode("http://www.example.com")
    .AddEmptyLines(5)
    .Cut();

To send the commands to the printer, either use the print command (this will clear the command buffer)

manager.Print();

or use the PrintAndContinue command, to keep the buffer (for repetitive printing of the same receipt, for example)

manager.PrintAndContinue();

If you have any issues with this package, or would like more features (commands) added to the DocumentManager, feel free to open a feature or a pull request on this repository!

Packages Used

  • RawPrint
  • ESCPOS
Product Compatible and additional computed target framework versions.
.NET net8.0-windows7.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.0.2 201 8/23/2024
0.0.1 95 6/17/2024