CondeS.MauiPrintKit 1.0.0

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

// Install CondeS.MauiPrintKit as a Cake Tool
#tool nuget:?package=CondeS.MauiPrintKit&version=1.0.0                

MauiPrintKit

MauiPrintKit is a versatile library designed to simplify printing tasks across various devices, with a current focus on Android platforms. Specifically tailored for ESC/POS printers, it currently provides seamless integration for printing images to Bluetooth printers in android. Whether you're a developer seeking to incorporate printing capabilities into your Android applications or an enthusiast looking to streamline printing processes, MauiPrintKit offers an intuitive solution.

Key Features:

  • Seamless integration with Android for effortless printing tasks.
  • Support for ESC/POS printers ensures compatibility across a wide range of devices.
  • Simplified image printing to Bluetooth printers for enhanced convenience.
  • Extensible architecture for future expansion and additional platform support.
  • With MauiPrintKit, printing becomes a straightforward process, empowering developers and users alike to harness the full potential of printing technology across various environments.

In MauiProgram.cs in the CreateMauiApp add UseMauiPrintKit as shown below.

 
   public static MauiApp CreateMauiApp()
    {
            var builder = MauiApp.CreateBuilder();
            builder.UseMauiApp<App>()
                .UseMauiPrintKit()
                .ConfigureFonts(fonts =>
                {
                    fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
                    fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
                });

            return builder.Build();
    }

Inject the IPrinterService

var  _printerService = App.Current!.MainPage!.Handler!.MauiContext!
    .Services.GetRequiredService<IPrintingService>();
 

Usage (Remember to configure all bluetooth request requirements for your app.)

//Set your printers name, this printer must be already connected to the device.
_printerService.SetPrinter("Your Printer Name");
//Print Image 
await _printerService.PrintImageAsync(imageStream.ToArray());
 
Product Compatible and additional computed target framework versions.
.NET net8.0-android34.0 is compatible.  net8.0-ios17.0 is compatible.  net8.0-maccatalyst17.0 is compatible.  net8.0-windows10.0.19041 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
1.0.0 142 3/7/2024

Currently only has support for android apps