The Genius Scan SDK provides a pre-built scanning interface called ScanFlow that enables you to add document scanning to your app with just a few lines of code. ScanFlow is highly configurable, allowing you to adapt it to your specific needs. This guide will help you get started quickly.
The simple demo projects from our demo repository demonstrate how to configure document scanning.
Before implementing document scanning, you need to install and configure the SDK.
Once you’ve installed and configured the SDK, implement document scanning in just a few lines:
// Create configuration
let configuration = GSKScanFlowConfiguration()
configuration.multiPage = true
configuration.pdfPageSize = .a4
// Start the scan flow
do {
let result = try await GSKScanFlow(configuration: configuration)
.resultByStarting(fromViewController: self)
let pdfUrl = result.multiPageDocumentURL
print("PDF saved at: \(pdfUrl)")
} catch {
print("Scanning failed: \(error.localizedDescription)")
}
If you cannot use the modern Async/Await API, the SDK also provides closure-based APIs.
// Create configuration
val configuration = ScanConfiguration().apply {
multiPage = true
pdfPageSize = ScanConfiguration.PdfPageSize.A4
}
// Start the scan flow
ScanFlow.scanWithConfiguration(this, configuration)
// Handle the result in onActivityResult
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
try {
val result = ScanFlow.getScanResultFromActivityResult(data)
val pdfFile = result.multiPageDocument
val pages = result.pages
Log.d("Scanner", "PDF saved at: ${pdfFile.absolutePath}")
} catch (e: Exception) {
Log.e("Scanner", "Scanning failed", e)
}
}
import { scanWithConfiguration } from "@thegrizzlylabs/web-geniusscan-sdk";
// Configure and launch scanner
const configuration = {
multiPage: true,
multiPageFormat: "pdf",
pdfPageSize: "a4",
jpegQuality: 60
};
try {
const result = await scanWithConfiguration(configuration);
// Handle the result
const { scans, multiPageDocument } = result;
// Process individual scanned pages
for (const scan of scans) {
const imageBlob = scan.enhancedImage.data;
console.log("Scanned page:", imageBlob);
}
// Process PDF if generated
if (multiPageDocument) {
const pdfBlob = new Blob([multiPageDocument.data],
{ type: multiPageDocument.type });
console.log("PDF generated:", pdfBlob);
}
} catch (error) {
// Handle error or user cancellation
console.error("Scanning failed:", error);
}
import RNGeniusScan from '@thegrizzlylabs/react-native-genius-scan';
// Configure scan flow
const configuration = {
multiPage: true,
multiPageFormat: 'pdf',
pdfPageSize: 'a4',
jpegQuality: 60
};
try {
// Launch scanner
const result = await RNGeniusScan.scanWithConfiguration(configuration);
// Handle the result
const { multiPageDocumentUrl, scans } = result;
console.log("PDF saved at:", multiPageDocumentUrl);
// Process individual pages
for (const scan of scans) {
console.log("Page:", scan.enhancedUrl);
}
} catch (error) {
// Handle cancellation or error
console.error("Scanning failed:", error);
}
import 'package:flutter_genius_scan/flutter_genius_scan.dart';
// Configure scan flow
var configuration = {
'multiPage': true,
'multiPageFormat': 'pdf',
'pdfPageSize': 'a4',
'jpegQuality': 60,
};
try {
// Launch scanner
var result = await FlutterGeniusScan.scanWithConfiguration(configuration);
// Handle the result
String? pdfUrl = result['multiPageDocumentUrl'];
List<dynamic> scans = result['scans'];
print("PDF saved at: $pdfUrl");
// Process individual pages
for (var scan in scans) {
print("Page: ${scan['enhancedUrl']}");
}
} catch (error) {
// Handle cancellation or error
print("Scanning failed: $error");
}
// Configure scan flow
var configuration = {
multiPage: true,
multiPageFormat: 'PDF',
pdfPageSize: 'A4',
jpegQuality: 60
};
// Launch scanner
cordova.plugins.GeniusScan.scanWithConfiguration(configuration,
// Success callback
function(result) {
var pdfUrl = result.multiPageDocumentUrl;
var scans = result.scans;
console.log("PDF saved at:", pdfUrl);
// Process individual pages
scans.forEach(function(scan) {
console.log("Page:", scan.enhancedUrl);
});
},
// Error callback
function(error) {
console.error("Scanning failed:", error);
}
);
For .NET MAUI (and Xamarin), the Genius Scan SDK .NET MAUI packages for iOS and Android provide wrappers around the native APIs. We recommend that you create a bridging service class similar to the one we have in the demos, that you can then call from your .NET MAUI code.
namespace SimpleDemo
{
public partial class ScanFlowService
{
public partial void SetLicenseKey(string licenseKey);
public partial Task<string> StartScanning();
public partial Task<string> StartScanningReadableCodes(Dictionary<string, object> configuration);
}
}
This class can then be implemented for iOS and Android similarly to what we have in the demo:
See demo for the service class.
See demo for the service class.
Starting a scan flow is then as simple as:
var documentUrl = await scanFlowService.StartScanning();
Feature | iOS | Android | Cross-platform | Web |
---|---|---|---|---|
Multi-page scanning | ✅ | ✅ | ✅ | ✅ |
PDF output format | ✅ | ✅ | ✅ | ✅ |
TIFF output format | ✅ | ✅ | ✅ | ❌ |
PDF page size | ✅ | ✅ | ✅ | ✅ |
JPEG quality | ✅ | ✅ | ✅ | ✅ |
Post-processing filters | ✅ | ✅ | ✅ | ✅ |
Source (camera/gallery) | ✅ | ✅ | ✅ | ❌ |
Feature | iOS | Android | Cross-platform | Web |
---|---|---|---|---|
Live document detection | ✅ | ✅ | ✅ | ✅ |
Perspective correction | ✅ | ✅ | ✅ | ✅ |
Curvature correction | ✅ | ✅ | ✅ | ✅ |
Rotation | ✅ | ✅ | ✅ | ✅ |
Crop adjustment | ✅ | ✅ | ✅ | ✅ |
Feature | iOS | Android | Cross-platform | Web |
---|---|---|---|---|
Skip post-processing screen | ✅ | ✅ | ✅ | ❌ |
Flash mode control | ✅ | ✅ | ✅ | ❌ |
Custom UI colors | ✅ | ✅ | ✅ | ✅ |
Feature | iOS | Android | Cross-platform | Web |
---|---|---|---|---|
Blur detection | ✅ | ✅ | ✅ | ❌ |
Auto-trigger capture | ✅ | ✅ | ✅ | ✅ |
Feature | iOS | Android | Cross-platform | Web |
---|---|---|---|---|
OCR (text recognition) | ✅ | ✅ | ✅ | ❌ |
Receipt scanning | ✅ | ✅ | ✅ | ❌ |
Business card scanning | ✅ | ❌ | ❌ | ❌ |
Bank details extraction | ✅ | ❌ | ❌ | ❌ |
Barcode detection in documents | ✅ | ✅ | ✅ | ❌ |
The configuration properties follow the same naming scheme but have been tailored to the specifics of each platform:
GSKScanFlowConfiguration
- API ReferenceScanConfiguration
- API ReferenceThe SDK is localized in 20 of the most commonly used languages.
The features of the SDK will be localized in the device’s active language, except for the Web SDK for which you can specify the language in the configuration with the "language": "fr"
key/value.
© 2025 The Grizzly Labs. All rights reserved.