NEWSMRZ Scanner is now part of barKoder.What it means for you →

DOCUMENTATION

.NET MAUI

Cross-platform apps

Documentation / Cross-platform apps

On this page

Package: MRZScanner.Maui on NuGet: one package for Android, iOS and Windows.

Needs: .NET 10 with MAUI. Android 7.0 (API 24) or later and iOS 15 or later: the camera screen with AR mode, and photos. Windows 10 (x64): photos; the camera scan on Windows is coming.

Install

dotnet add package MRZScanner.Maui

In MauiProgram.cs:

builder.UseMauiApp<App>().UseMrzScanner();

iOS: a camera usage text in Platforms/iOS/Info.plist:

<key>NSCameraUsageDescription</key>
<string>Scans the MRZ of passports and ID cards.</string>

iOS 27

iOS 27 requires the scene lifecycle, which the MAUI 10 app template does not set up: the app stops at launch, with or without this package. Add to Info.plist:

<key>UIApplicationSceneManifest</key>
<dict>
  <key>UIApplicationSupportsMultipleScenes</key><false/>
  <key>UISceneConfigurations</key>
  <dict>
    <key>UIWindowSceneSessionRoleApplication</key>
    <array>
      <dict>
        <key>UISceneConfigurationName</key><string>__MAUI_DEFAULT_SCENE_CONFIGURATION__</string>
        <key>UISceneDelegateClassName</key><string>SceneDelegate</string>
      </dict>
    </array>
  </dict>
</dict>

and to Platforms/iOS:

[Register("SceneDelegate")] public class SceneDelegate : MauiUISceneDelegate { }

Use

using MRZScanner.Maui;

await MrzScanner.RegisterLicenseAsync("MRZ2...");      // once; without it some fields are masked

var result = await MrzScanner.ScanAsync(new ScanSettings { DocumentTypes = DocumentTypes.Passport | DocumentTypes.Id });
if (result.Status == ScanStatus.Read)
{
    var read = result.Reads[0];
    Console.WriteLine($"{read.Text} {read.Field("document_number")} {read.CheckDigitsValid}");
}

var fromPhoto = await MrzScanner.ScanImageAsync(photoPath);   // or the bytes of a JPEG / PNG

ScanAsync(settings) opens the camera (asking for the permission). ScanResult has Status (Read, Stopped, Timeout, PermissionDenied, LicenseInactive, Error), Reads and Elapsed. ScanSettings has the settings in Scan settings, in C# style: Continuous, DuplicateTimeout, Confirmation, Timeout, Torch, Zoom, VibrateOnRead, ArOverlay, DocumentTypes, RegionOfInterest, IsolateMrz, IsolatedHeight, Title.

Updated Oct 24, 2026 ยท Questions? Ask us