Plugin.Maui.DocumentScanner
0.1.0
dotnet add package Plugin.Maui.DocumentScanner --version 0.1.0
NuGet\Install-Package Plugin.Maui.DocumentScanner -Version 0.1.0
<PackageReference Include="Plugin.Maui.DocumentScanner" Version="0.1.0" />
<PackageVersion Include="Plugin.Maui.DocumentScanner" Version="0.1.0" />
<PackageReference Include="Plugin.Maui.DocumentScanner" />
paket add Plugin.Maui.DocumentScanner --version 0.1.0
#r "nuget: Plugin.Maui.DocumentScanner, 0.1.0"
#:package Plugin.Maui.DocumentScanner@0.1.0
#addin nuget:?package=Plugin.Maui.DocumentScanner&version=0.1.0
#tool nuget:?package=Plugin.Maui.DocumentScanner&version=0.1.0
Plugin.Maui.DocumentScanner
Native document scanning for .NET MAUI — no paid SDK required.
- Android: ML Kit document scanner (full scanner UI, auto-crop, filters; models downloaded via Google Play services)
- iOS: VisionKit document camera for scanning, plus Vision document segmentation with a built-in corner editor for cropping already-taken photos
Supports Android API 23+ (with Google Play services) and iOS 15+.
Setup
Install the package, then register it in MauiProgram.cs:
builder
.UseMauiApp<App>()
.UseDocumentScanner();
UseDocumentScanner() registers IDocumentScanner in dependency injection and hooks the Android activity-result plumbing — no MainActivity changes needed.
Usage
Inject IDocumentScanner (or use DocumentScanner.Default without DI):
// Camera scan — returns file paths of cropped pages, empty list on cancel
IReadOnlyList<string> pages = await scanner.ScanAsync();
// Crop already-taken photos from the photo library
IReadOnlyList<string> pages = await scanner.ScanFromPhotosAsync();
// With options
var pages = await scanner.ScanAsync(new DocumentScanOptions
{
PageLimit = 3,
Mode = DocumentScannerMode.Base, // Android only: Full, BaseWithFilter, or Base
});
Check scanner.IsSupported first; ScanAsync throws NotSupportedException on devices without a scanner implementation.
Returned files are JPEGs written to the app's cache directory — move or copy them if you need them to persist.
Platform notes
| Android | iOS | |
|---|---|---|
ScanAsync |
ML Kit scanner UI | VisionKit document camera |
ScanFromPhotosAsync |
ML Kit scanner with gallery import | Photo picker + auto-detected corners + manual corner editor |
PageLimit |
Applies to both methods | Photo import only (VisionKit has no limit) |
Mode |
Full / BaseWithFilter / Base | Ignored |
Sample
The samples/ScanTest app exercises both scan paths and shows page sizes and timings.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0-android36.0 is compatible. net10.0-ios26.0 is compatible. |
-
net10.0-android36.0
- Microsoft.Maui.Controls (>= 10.0.20)
- Xamarin.AndroidX.Lifecycle.LiveData.Core (>= 2.11.0.1)
- Xamarin.GooglePlayServices.MLKit.DocumentScanner (>= 116.0.0.3)
-
net10.0-ios26.0
- Microsoft.Maui.Controls (>= 10.0.20)
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.1.0 | 61 | 8/24/2026 |