Docutain.SDK.MAUI 3.0.0

dotnet add package Docutain.SDK.MAUI --version 3.0.0
                    
NuGet\Install-Package Docutain.SDK.MAUI -Version 3.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Docutain.SDK.MAUI" Version="3.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Docutain.SDK.MAUI" Version="3.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Docutain.SDK.MAUI" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Docutain.SDK.MAUI --version 3.0.0
                    
#r "nuget: Docutain.SDK.MAUI, 3.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Docutain.SDK.MAUI@3.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Docutain.SDK.MAUI&version=3.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Docutain.SDK.MAUI&version=3.0.0
                    
Install as a Cake Tool

Docutain SDK for .NET MAUI

Add document scanning, OCR text recognition, data extraction and PDF creation to your .NET MAUI app — for Android and iOS, from one shared codebase.

Everything runs on the device. No cloud, no server round trip, no data leaving the phone, and it works without a network connection.

NuGet Downloads

What you get

  • Document Scanner — ready-to-use UI with automatic edge detection, perspective correction, image filters, multi-page support and a page editing screen. Fully themeable: colors, texts, buttons, icons, onboarding and scan tips.
  • OCR — text recognition of the scanned pages or of an imported PDF.
  • Data Extraction — read address, IBAN, BIC, amount, date, invoice number and more as JSON.
  • Photo Payment — turn a photo of an invoice into payment data, including GiroCode.
  • PDF Creation — searchable PDFs with selectable text, page format and maximum file size, plus JPG export of single pages.

Individually licensable, so you only pay for the modules you use.

Requirements

.NET 9 or 10
Android 6.0 (API 23) or higher
iOS 13.0 or higher

Getting started

1. Initialize

Call this once on app start, before anything else of the SDK.

public partial class App : Application
{
    public App()
    {
        InitializeComponent();

        if (!DocutainSDK.InitSDK("<YOUR-LICENSE-KEY>"))
        {
            // Initialization failed - DocutainSDK.LastError says why.
            // Do not call any other SDK method in this case.
            var error = DocutainSDK.LastError;
        }
    }
}

You can pass an empty license key for a first look, but the SDK then stops working after one minute. Get a free extended trial key at sdk.docutain.com/TrialLicense.

On iOS, add a camera usage description to your Info.plist, otherwise the app is terminated when the scanner opens:

<key>NSCameraUsageDescription</key>
<string>In order to scan documents, you need to grant permission to access the camera.</string>

2. Scan a document

var scanConfig = new DocumentScannerConfiguration();
bool scanned = await UI.ScanDocument(scanConfig);

DocumentScannerConfiguration is where you adapt the scan process and the look of the UI — see Change default scan behaviour.

3. Create a PDF

The generated PDF contains the recognized text, so it is searchable and the text is selectable.

var pdf = await Document.WritePDFAsync(Path.Combine(FileSystem.CacheDirectory, "Scan.pdf"));

4. Read text and data

var text = await DocumentDataReader.GetTextAsync();      // OCR of all pages
var json = await DocumentDataReader.AnalyzeAsync();      // extracted fields as JSON

5. Export images

for (int page = 1; page <= Document.PageCount; page++)
    await Document.WriteImageAsync(page, Path.Combine(folder, $"Page_{page}.jpg"));

Photo Payment

var paymentConfig = new PhotoPaymentConfiguration();
string? result = await UI.StartPhotoPayment(paymentConfig);

if (result == null)
{
    // the user canceled
}
else if (result.Length == 0)
{
    // nothing was detected - only reachable if you disabled the empty result screen
}
else
{
    // result is a JSON string with the payment data, ready for your payment sheet
}

If your app was opened from another app via "open with" or "share", hand the received files over instead of opening the camera:

paymentConfig.ExternalFilePaths = new List<string> { receivedFilePath };

Sync and async

Every operation that touches files or runs recognition comes in both flavours. The …Async variant does the work on a background thread, which keeps the UI responsive — recommended for anything but the smallest documents.

Synchronous Asynchronous
Document.LoadFile Document.LoadFileAsync
Document.WritePDF Document.WritePDFAsync
Document.WriteImage Document.WriteImageAsync
Document.GetImageBytes Document.GetImageBytesAsync
DocumentDataReader.LoadFile DocumentDataReader.LoadFileAsync
DocumentDataReader.GetText DocumentDataReader.GetTextAsync
DocumentDataReader.Analyze DocumentDataReader.AnalyzeAsync
DocumentDataReader.SetAnalyzeConfiguration DocumentDataReader.SetAnalyzeConfigurationAsync
DocutainSDK.DeleteTempFiles DocutainSDK.DeleteTempFilesAsync

Error handling

Methods that can fail in an expected way return null or false, and DocutainSDK.LastError tells you why. Everything the SDK itself gets wrong is an exception:

Exception Means
DocutainSdkNotInitializedException InitSDK was not called or did not succeed
DocutainSdkConfigurationException a configuration member was rejected; Member names it
DocutainSdkFileAccessException the file could not be loaded, e.g. a wrong PDF password
DocutainSdkNoHostException the app currently has no screen to present the scanner on

Upgrading from 2.x

Version 3.0.0 requires .NET 9 or 10 and is binary breaking, so rebuild your app rather than swapping the assembly. The migration guide lists every change.

Documentation and sample app

License and support

The Docutain SDK is a commercial product and requires a paid license for production use. Get a free trial key at sdk.docutain.com/TrialLicense.

Technical questions: support.sdk@Docutain.com

Product Compatible and additional computed target framework versions.
.NET net9.0-android35.0 is compatible.  net9.0-ios18.0 is compatible.  net10.0-android was computed.  net10.0-android36.0 is compatible.  net10.0-ios was computed.  net10.0-ios26.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
3.0.0 106 9/7/2026
2.1.0 444 10/8/2025
2.0.0 459 5/12/2025
1.3.3 472 2/22/2025
1.3.2 311 1/30/2025
1.3.1 328 1/11/2025
1.3.0 382 12/9/2024
1.2.2 2,006 4/18/2024
1.2.0 361 3/14/2024
1.1.0 322 2/13/2024
1.0.2 590 8/14/2023
1.0.0 461 7/5/2023