BrotherPrintLibraryV3 0.0.351
dotnet add package BrotherPrintLibraryV3 --version 0.0.351
NuGet\Install-Package BrotherPrintLibraryV3 -Version 0.0.351
<PackageReference Include="BrotherPrintLibraryV3" Version="0.0.351" />
<PackageVersion Include="BrotherPrintLibraryV3" Version="0.0.351" />
<PackageReference Include="BrotherPrintLibraryV3" />
paket add BrotherPrintLibraryV3 --version 0.0.351
#r "nuget: BrotherPrintLibraryV3, 0.0.351"
#:package BrotherPrintLibraryV3@0.0.351
#addin nuget:?package=BrotherPrintLibraryV3&version=0.0.351
#tool nuget:?package=BrotherPrintLibraryV3&version=0.0.351
BrotherPrintLibrary
This library provides bindings to the Brother Mobile SDK.
Two variations of the library are published for the two suported major versions.
BrotherPrintLibraryV3
BrotherPrintLibraryV4
Minimal changes are made to the library, and code samples from Brother should generally work without any issues.
Get started
On Android, you need to grant these permissions (could be narrower, but I've never tested it out~):
Platforms/Android/MainApplication.cs
[assembly: UsesPermission(Android.Manifest.Permission.Bluetooth)]
[assembly: UsesPermission(Android.Manifest.Permission.BluetoothAdmin)]
[assembly: UsesPermission(Android.Manifest.Permission.BluetoothScan)]
[assembly: UsesPermission(Android.Manifest.Permission.BluetoothConnect)]
[assembly: UsesPermission(Android.Manifest.Permission.AccessNetworkState)]
[assembly: UsesPermission(Android.Manifest.Permission.AccessWifiState)]
[assembly: UsesPermission(Android.Manifest.Permission.Internet)]
[assembly: UsesPermission(Android.Manifest.Permission.AccessCoarseLocation)]
[assembly: UsesPermission(Android.Manifest.Permission.AccessFineLocation)]
[assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)]
Code example for BrotherPrintLibraryV3
, to print out basic text and QR code is provided below.
var printer = new Printer();
printer.SetBluetooth(BluetoothAdapter.DefaultAdapter);
var scaleFactor = 4;
var baseTextSize = 150;
var basePadding = 20;
var baseQrSize = 256;
printer.SetPrinterInfo(new PrinterInfo
{
WorkPath = Android.App.Application.Context.CacheDir?.ToString(),
PrinterModel = PrinterInfo.Model.PtP710bt,
MacAddress = "<SCAN_TO_RETRIEVE>",
LocalName = "<SCAN_TO_RETRIEVE>",
LabelNameIndex = LabelInfo.LabelColor.Red!.Id,
IsAutoCut = true,
IsLabelEndCut = true,
IsHalfCut = false,
IsSpecialTape = false,
IsCutAtEnd = true,
IsCutMark = true,
});
var qr = new ZXing.Android.BarcodeWriter
{
Format = BarcodeFormat.QR_CODE,
Options = new ZXing.Common.EncodingOptions
{
Margin = 2,
Width = baseQrSize * scaleFactor,
Height = baseQrSize * scaleFactor
}
};
var qrBitmap = qr.WriteAsBitmap("https://www.example.com");
var textPaint = new Paint
{
Color = Color.Black,
SubpixelText = true,
AntiAlias = true,
TextSize = baseTextSize * scaleFactor,
};
var textToDraw = "https://example.com";
var textBounds = new Android.Graphics.Rect();
textPaint.GetTextBounds(textToDraw, 0, textToDraw.Length, textBounds);
int padding = 20 * scaleFactor;
var landscapeBitmap = Bitmap.CreateBitmap(
qrBitmap.Width + textBounds.Width() + padding * 2,
qrBitmap.Height,
Bitmap.Config.Argb8888
);
var landscapeCanvas = new Canvas(landscapeBitmap);
landscapeCanvas.DrawColor(Color.White);
landscapeCanvas.DrawBitmap(qrBitmap, 0, 0, null);
float textY = (landscapeBitmap.Height + textBounds.Height()) / 2.0f;
landscapeCanvas.DrawText(textToDraw, qrBitmap.Width + padding, textY, textPaint);
var matrix = new Android.Graphics.Matrix();
matrix.PostRotate(90);
var finalBitmap = Bitmap.CreateBitmap(
landscapeBitmap,
0,
0,
landscapeBitmap.Width,
landscapeBitmap.Height,
matrix,
true
);
var output = printer.PrintImage(finalBitmap);
Copyright
Copyright 2025 Brother Mobile Solutions
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0-android35.0 is compatible. net10.0-android was computed. |
-
net9.0-android35.0
- 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 |
---|---|---|
0.0.351 | 58 | 7/6/2025 |