Document Scanner for Compose Multiplatform (Android/iOS) using VNDocumentCameraViewController on iOS and MLKit Document scanner on Android.
Supported Compose version:
| Compose version | EasyDocumentScan Version |
|---|---|
| 1.7 | 0.1.0+ |
| 1.8 | 0.2.0+ |
| 1.9 | 0.3.0+ |
Add the dependency to your commonMain sourceSet (KMP) / Android dependencies (android only):
implementation("io.github.kalinjul.easydocumentscan:documentscanner:0.3.1")Or, for your libs.versions.toml:
[versions]
easydocumentscan = "0.3.1"
[libraries]
easydocumentscan = { module = "io.github.kalinjul.easydocumentscan:documentscanner-compose", version.ref = "easydocumentscan" }val scanner = rememberDocumentScanner(
onResult = {
// handle result images
},
options = DocumentScannerOptions(
DocumentScannerOptionsAndroid(
pageLimit = 3,
allowGalleryImport = true,
scannerMode = DocumentScannerModeAndroid.BASE
),
DocumentScannerOptionsIos(
captureMode = DocumentCaptureMode.MANUAL
)
)
)
Button(onClick = { scanner.scan() }) {
Text("Scan")
}Check out the included sample app.