Creating a .NET MAUI document scanner that can capture, normalize, and share documents effortlessly is an exciting task for any developer. With the Dynamsoft Capture Vision MAUI Bundle, you can leverage powerful APIs for document scanning, barcode reading, and MRZ recognition to create a seamless user experience.

In this tutorial, we'll explore how to build a .NET MAUI document scanner that can capture and normalize documents on both Android and iOS platforms. This is part of a 5-part series, where we'll dive deeper into creating various applications using .NET MAUI.

Prerequisites

Before getting started, ensure you have the following tools installed:

  • Dynamsoft Capture Vision Trial License
  • Xcode
  • Android Studio
  • Visual Studio for Windows or Visual Studio Code for macOS with the .NET MAUI extension
  • Provisioning Profile for iOS (required if building a .NET MAUI app with Visual Studio Code on macOS)

Building a .NET MAUI Document Scanner Step by Step

Dynamsoft provides a .NET MAUI sample project demonstrating how to automatically capture and normalize documents from a camera stream. Based on this sample, we'll make a few modifications:

  • Update the target framework from net7.0 to net8.0.
  • Add a button to trigger document capture and rectification.
  • Allow users to share the normalized document to other apps.

Updating the .NET MAUI Project from .NET 7 to .NET 8

The latest .NET version is 8.0, while the sample project uses .NET 7.0. To update the target framework:

  • Open the .csproj file and change the TargetFramework value from net7.0 to net8.0.
  • Add to the PropertyGroup element to ensure compatibility: 11.0 .

Adding a Round Button for Document Capture

  • Update the CameraPage.xaml file to add a round button for document capture:

`xml

xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"

x:Class="AutoNormalize.CameraPage"

Title="Auto Normalize">