Skip to content

kalinjul/EasyDocumentScan

Repository files navigation

EasyDocumentScan: Compose Multiplatform Document Scanner

CI Status Maven Central Snapshot Kotlin Version Compose Version

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+

Dependency

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" }

Usage

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.

About

Compose Multiplatform Document Scanner

Resources

License

Stars

Watchers

Forks

Packages

No packages published