RazorMrzLibrary 1.0.0
Please use the built-in Dynamsoft JavaScript SDK directly within your Blazor project to access the full range of functionalities.
dotnet add package RazorMrzLibrary --version 1.0.0
NuGet\Install-Package RazorMrzLibrary -Version 1.0.0
<PackageReference Include="RazorMrzLibrary" Version="1.0.0" />
paket add RazorMrzLibrary --version 1.0.0
#r "nuget: RazorMrzLibrary, 1.0.0"
// Install RazorMrzLibrary as a Cake Addin #addin nuget:?package=RazorMrzLibrary&version=1.0.0 // Install RazorMrzLibrary as a Cake Tool #tool nuget:?package=RazorMrzLibrary&version=1.0.0
Razor MRZ Library
A Razor Class Library built using the Dynamsoft Label Recognizer SDK, which provides APIs for scanning MRZ (Machine Readable Zone) on passports and IDs.
Online Demo
https://yushulx.me/Razor-MRZ-Library/
Prerequisites
Quick Usage
Import and initialize the Razor MRZ Library.
@using RazorMrzLibrary @code { private MrzJsInterop? mrzJsInterop; protected override async Task OnInitializedAsync() { mrzJsInterop = new MrzJsInterop(JSRuntime); await mrzJsInterop.LoadJS(); } }
Set the license key and load the wasm module.
await mrzJsInterop.SetLicense(licenseKey); await mrzJsInterop.LoadWasm();
Createa a MRZ recognizer instance.
MrzRecognizer recognizer = await mrzJsInterop.CreateMrzRecognizer();
Recognize MRZ text from an image.
List<OcrResult> results = await recognizer.DecodeCanvas(canvas);
Parse MRZ text.
string[] lines = new string[results.Count]; for (int i = 0; i < results.Count; i++) { lines[i] = result.Text; } MrzResult mrzResult = MrzParser.Parse(lines);
API
OcrResult Class
Represents a line of text recognized by the OCR engine.
MrzResult Class
Represents the result of parsing MRZ text.
MrzParser Class
static MrzResult Parse(string[] lines)
: Parses MRZ text.
MrzRecognizer Class
Task<List<OcrResult>> DecodeCanvas(IJSObjectReference canvas)
: Recognizes MRZ text from a canvas object.
MrzJsInterop Class
Task LoadJS()
: Loads the Dynamsoft Label Recognizer JavaScript library.Task SetLicense(string license)
: Sets the license key.Task LoadWasm()
: Loads the Dynamsoft Label Recognizer WebAssembly module.Task<MrzRecognizer> CreateMrzRecognizer()
: Creates a MRZ recognizer instance.
Example
Build
cd RazorMrzLibrary
dotnet build --configuration Release
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. 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. |
-
net7.0
- Microsoft.AspNetCore.Components.Web (>= 7.0.11)
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 |
---|
- Added MRZ recognition API.