XML2ESCPOS 0.5.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package XML2ESCPOS --version 0.5.2
NuGet\Install-Package XML2ESCPOS -Version 0.5.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="XML2ESCPOS" Version="0.5.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add XML2ESCPOS --version 0.5.2
#r "nuget: XML2ESCPOS, 0.5.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 XML2ESCPOS as a Cake Addin
#addin nuget:?package=XML2ESCPOS&version=0.5.2

// Install XML2ESCPOS as a Cake Tool
#tool nuget:?package=XML2ESCPOS&version=0.5.2

XML2ESCPOS

Net Standard library that provides a simple XML Template engine with support for images, variables and loops. For ESC / POS Thermal Printers. You can print to Windows printers (using the print queue so windows takes care of waiting for it to turn on or have paper) or directly to network printers.

Example:

string plantilla = "<C><RESET/><CENTER/><B>Hello!</B><BR><BR><END/></C>";

XML2ESCPOS.XML2ESCPOS.Print("Epson", plantilla, false);

Printer print:

                         **Hello!**
Usage:

Print(PrinterOrIP, Plantilla, EsIP, NombreTrabajo, CodePage, Vars, BucleVars)

ImpresoraOrIP: (Required String) Windows Printer Name if EsIP = false or IP Address if EsIP = true

Plantilla: (Required String) String with the Template

EsIP: (Optional Bool, Default is True) If PrinterOrIp is System Windows Printer Name you must set to false. If PrinterOrIP is Ip Address you can ignore it or you can set to True

NombreTrabajo: (Optional String, Default is "Printer Job") Print job name

CodePage: (Optional Int, Default is 858) Codepage that has the thermal printer configured. https://docs.microsoft.com/en-us/windows/win32/intl/code-page-identifiers

Vars: (Opcional List<KeyValuePair<string, string>>) List of the variables that you are going to use with their name and value. More Info

BubleVars: (Opcional IEnumerable<KeyValuePair<string, string>>) List of variables that are the lists that you will use with each loop with its name More Info

Vars:

Example:

string plantilla = "<C><RESET/><LEFT/><B>Hello <![CDATA[MyName]]>!</B><BR><BR><END/></C>";

List<KeyValuePair<string, string>> valores = new List<KeyValuePair<string, string>>();

valores.Add(new KeyValuePair<string, string>("MyName", "Jesus"));

XML2ESCPOS.XML2ESCPOS.Print("Epson", plantilla, false, Vars:valores);

Printer print:

Hello Jesus!

BucleVars:

Example:

public class Client
{
    public string Name { get; set; }
}

string plantilla = "<C><RESET/><LEFT/><LOOP VARNAME='clientes'><B>Hello <![CDATA[cliente.Name]]>!</B><BR></LOOP><BR><END/></C>";

List<Client> lc = new List<Client>();
lc.Add(new ClienteT { Name = "Jesus" });
lc.Add(new ClienteT { Name = "Juan" });

List<KeyValuePair<string,object>> valoresBucle = new List<KeyValuePair<string,object>>();
KeyValuePair<string,object> clientevar = new KeyValuePair<string,object>("cliente", lc);
valoresBucle.Add(clientevar);

XML2ESCPOS.XML2ESCPOS.Print("Epson", plantilla, false, BucleVars:valoresBucle);

Printer print:

Hello Jesus!

Hello Juan!

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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen 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

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.6.4 2,306 5/21/2021
0.6.3 329 4/17/2021
0.6.2 328 4/17/2021
0.6.1 298 4/15/2021
0.6.0 302 4/14/2021
0.5.2 277 4/14/2021
0.5.1 306 4/14/2021
0.5.0 310 4/14/2021