The Document Capture Activity
Capturing a document image can be initiated with the following to start the activity:
val docSession = Dockware.instance.startDocumentCaptureActivity(this)
Additional properties can be configured with DSL syntax (full list here):
val docSession = Dockware.instance.startDocumentCaptureActivity(context = context) {
titlesNoun = "Pick Ticket" // Noun to insert in titles
uploadShipmentId = "ee1d80bb-a656-4c1d-b095-799730019d1c" // An existing shipment ID
onFinish = {}
}
To collect the captured image, use the documentCaptured stateflow from the session object:
lifecycleScope.launch {
docSession.documentCaptured.collect {
Log.d(TAG, "document image capture: $it")
}
}
To collect the parsed results for the document, use the session's documentsProcessed stateflow:
lifecycleScope.launch {
docSession.documentProcessed.collect {
Log.d(TAG, "document image processed: $it")
}
}
Bonus
You can use the startCaptureActivities() function to capture a document, then immediately capture a 3D object with a single CaptureActivities session that contains both the document and object capture data.