Skip to content

kalinjul/EasyDocumentScan

Repository files navigation

EasyDocumentScan: Compose Multiplatform Document Scanner

CI Status Maven Central Kotlin Version Compose Version

Document Scanner for Compose Multiplatform (Android/iOS) using VNDocumentCameraViewController on iOS and MLKit Document scanner on Android.

Supported Compose versions:

EasyDocumentScan version Compose version Kotlin version
0.1.0+ 1.7 2.0
0.2.0+ 1.8 2.1
0.3.0+ 1.9 2.2
0.4.0+ 1.10 2.2
0.5.0+ 1.11 2.4

Dependency

Note

Starting with 0.3.2, artifact id changed from "documentscanner" to "documentscanner-compose" and a new "documentscanner-core" artifact was introduced that contains the KmpFile abstraction as well as some Helper functions.

Add the dependency to your commonMain sourceSet (KMP) / Android dependencies (android only):

implementation("io.github.kalinjul.easydocumentscan:documentscanner-compose:0.5.0")

Or, for your libs.versions.toml:

[versions]
easydocumentscanner = "0.5.0"
[libraries]
easydocumentscanner-compose = { module = "io.github.kalinjul.easydocumentscan:documentscanner-compose", version.ref = "easydocumentscanner" }
easydocumentscanner-core = { module = "io.github.kalinjul.easydocumentscan:documentscanner-core", version.ref = "easydocumentscanner" }

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

13 stars

Watchers

1 watching

Forks

Packages

 
 
 

Contributors