MaykeSN.PrinterLibrary 1.0.0

dotnet add package MaykeSN.PrinterLibrary --version 1.0.0
                    
NuGet\Install-Package MaykeSN.PrinterLibrary -Version 1.0.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="MaykeSN.PrinterLibrary" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MaykeSN.PrinterLibrary" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="MaykeSN.PrinterLibrary" />
                    
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 MaykeSN.PrinterLibrary --version 1.0.0
                    
#r "nuget: MaykeSN.PrinterLibrary, 1.0.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 MaykeSN.PrinterLibrary@1.0.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=MaykeSN.PrinterLibrary&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=MaykeSN.PrinterLibrary&version=1.0.0
                    
Install as a Cake Tool

PrinterLibrary

Biblioteca Windows para envio de comandos ZPL diretamente a impressoras Zebra (e compatíveis) via winspool.drv, sem dependências externas.

Instalação

dotnet add package MaykeSN.PrinterLibrary

ou pelo NuGet Package Manager:

Install-Package MaykeSN.PrinterLibrary

Uso

// Listar impressoras instaladas
List<string> printers = Printer.GetPrinters();

// Imprimir um ZPL
var printer = new Printer("^XA^FO50,50^ADN,36,20^FDHello World^FS^XZ", "ZDesigner GK420d");
bool ok = printer.Print();

// Calibrar a impressora
printer.Calibrate();

API

Printer(string zpl, string printerName)

Construtor. Recebe o ZPL a ser impresso e o nome exato da impressora (como aparece no Windows).

static List<string> GetPrinters()

Retorna a lista de todas as impressoras instaladas no Windows.

bool Print()

Envia o ZPL para a impressora via RAW. Retorna true em caso de sucesso, lança exceção em caso de falha.

void Calibrate()

Envia o comando ~JC para calibrar a impressora.

Requisitos

  • Windows
  • .NET Framework 4.7.2+

Licença

MIT

Product Compatible and additional computed target framework versions.
.NET Framework net472 is compatible.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.7.2

    • 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 Downloads Last Updated
1.0.0 130 4/30/2026