MrzScannerSDK 2.0.1
dotnet add package MrzScannerSDK --version 2.0.1
NuGet\Install-Package MrzScannerSDK -Version 2.0.1
<PackageReference Include="MrzScannerSDK" Version="2.0.1" />
paket add MrzScannerSDK --version 2.0.1
#r "nuget: MrzScannerSDK, 2.0.1"
// Install MrzScannerSDK as a Cake Addin #addin nuget:?package=MrzScannerSDK&version=2.0.1 // Install MrzScannerSDK as a Cake Tool #tool nuget:?package=MrzScannerSDK&version=2.0.1
.NET MRZ Scanner SDK
The .NET Machine-readable Zone (MRZ) Scanner SDK is a C# wrapper for Dynamsoft Label Recognizer, supporting x64 Windows, x64 Linux, Android and iOS. It is used to recognize MRZ information from passport, Visa, ID card and travel documents.
License Activation
Click here to get a trial license key.
Supported Platforms
- Windows (x64)
- Linux (x64)
- Android
- iOS
API
public static void InitLicense(string license)
: Initialize the license. It must be called before creating the MRZ scanner object.public static MrzScanner Create()
: Create the MRZ scanner object.public Result[]? DetectFile(string filename)
: Detect MRZ from an image file.public Result[]? DetectBuffer(byte[] buffer, int width, int height, int stride, ImagePixelFormat format)
: Detect MRZ from a buffer.public static string? GetVersionInfo()
: Get SDK version number.
Usage
Set the license key:
MrzScanner.InitLicense("LICENSE-KEY");
Initialize the MRZ scanner object:
MrzScanner scanner = MrzScanner.Create();
Detect MRZ from an image file:
Result[]? result = scanner.DetectFile(filename);
Detect MRZ from a buffer:
Result[]? result = scanner.DetectBuffer(bytes, width, height, stride, MrzScanner.ImagePixelFormat.IPF_RGB_888);
Get SDK version number:
string? version = MrzScanner.GetVersionInfo();
Parse the MRZ information:
string[] lines = new string[_results.Length]; var index = 0; foreach (Result result in _results) { lines[index++] = result.Text; } MrzResult info = MrzParser.Parse(lines);
Quick Start
using System;
using System.Runtime.InteropServices;
using Dynamsoft;
namespace Test
{
class Program
{
static void Main(string[] args)
{
MrzScanner.InitLicense("LICENSE-KEY");
Console.WriteLine("Version: " + MrzScanner.GetVersionInfo());
MrzScanner scanner = MrzScanner.Create();
MrzScanner.Result[]? results = scanner.DetectFile("1.png");
if (results != null)
{
foreach (MrzScanner.Result result in results)
{
Console.WriteLine(result.Text);
Console.WriteLine(result.Points[0] + ", " +result.Points[1] + ", " + result.Points[2] + ", " + result.Points[3] + ", " + result.Points[4] + ", " + result.Points[5] + ", " + result.Points[6] + ", " + result.Points[7]);
}
}
}
}
}
Example
Command-line MRZ Scanner (Windows & Linux)
# DEBUG dotnet run # RELEASE dotnet run --configuration Release
Command-line MRZ Scanner with OpenCVSharp Windows runtime. To make it work on Linux, you need to install OpenCVSharp4.runtime.ubuntu.18.04-x64 package.
dotnet run
WinForms Desktop MRZ Scanner (Windows Only)
dotnet run
Building NuGet Package from Source Code
# build dll for desktop
cd desktop
dotnet build --configuration Release
# build dll for android
cd android/sdk
dotnet build --configuration Release
# build dll for ios
cd ios/sdk
dotnet build --configuration Release
# build nuget package
nuget pack .\MrzScannerSDK.nuspec
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. net7.0-android was computed. net7.0-android33.0 is compatible. net7.0-ios was computed. net7.0-ios16.1 is compatible. 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. |
This package has 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 |
---|
Fixed assembly missing issue