Get Started Pixelnetica™ Document Scanning SDK for .NET MAUI
Installation
The Document Scanning SDK is distributed as a NuGet package for .NET MAUI. To install Pixelnetica.DocScanSDK.Maui
in Visual Studio:
- Open your solution in Visual Studio.
- Select the target project and go to
Project
→Manage NuGet Packages
. - Ensure
nuget.org
is set as the package source and search forPixelnetica.DocScanSDK.Maui
. - Click
Install
to add the DSSDK package to your project.
The SDK is ready to use after installation.
Permissions
Android Permissions
Add the following entries to your 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 these keys to your Info.plist
:
<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, ensuring this happens only once per application lifetime.
Pass the license key as a parameter to Init()
. It can be loaded from a variable, file, or other storage. If Init()
is called without parameters, the SDK will search for the key in the default locations:
Assets/License.key
on AndroidLicense.key
in 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 dependency on server availability—users without network access will not be able to use the SDK.
The following code snippets demonstrate platform-specific initialization:
On Android
ImageSdkWrapper.Droid.Main.Init();
On iOS
ImageSdkWrapper.iOS.Main.Init(this.GetType().Assembly);