Get Started Pixelnetica™ Document Scanning SDK for .NET MAUI
Installation
The Pixelnetica Document Scanning SDK for .NET MAUI is distributed as a NuGet package. To install the Pixelnetica.DocScanSDK.Maui package in Visual Studio:
- Open your solution in Visual Studio.
- Select the target project and go to
Project→Manage NuGet Packages. - Ensure
nuget.orgis set as the package source and search forPixelnetica.DocScanSDK.Maui. - Click
Installto add the DSSDK package to your project.
After installation, the SDK is referenced in your project and ready to use.
Permissions
Android Permissions
Add the following entries to your app’s AndroidManifest.xml file:
Require OpenGL ES 2.0 support:
<uses-feature android:glEsVersion="0x00020000" android:required="true" />Enable large heap and hardware acceleration in the
<application>tag:<application android:label="@string/ApplicationName" android:icon="@drawable/Icon" android:largeHeap="true" android:hardwareAccelerated="true">Request camera and flashlight access:
<uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.FLASHLIGHT" />
iOS Permissions
To allow document scanning from the camera and photo library, add the following keys to your app’s Info.plist file:
<key>NSCameraUsageDescription</key>
<string>This app requires access to the camera to take document photos.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>This app requires access to the photo library to load documents.</string>
Initialization
Initialize DSSDK before using it, and do so only once per application lifetime.
Pass your license key as a parameter to Init(). You can load it from a variable, a file, or other storage. If Init() is called without parameters, the SDK will search for the key in the default locations:
Assets/License.keyon AndroidLicense.keyin the project root on iOS
It is recommended to embed the license key in the application code. This ensures maximum availability and security but reduces flexibility, as any license update requires recompilation.
Alternatively, the license key can be stored on an external server and retrieved at runtime during SDK initialization. Note, however, that this approach introduces a dependency on server availability: users without network access will not be able to use the SDK.
Initialization requires a call to UsePixelnetica in CreateMauiApp. The following excerpt shows how to add UsePixelnetica to your existing CreateMauiApp implementation:
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UsePixelnetica()
.UseMauiCommunityToolkit()