Getting started with the Kotlin Multiplatform Barcode Scanner SDK's Compose UI
Integrating the Compose UI Components
The KMP SDK provides a Compose-based BarcodeScannerCustomUI component that encapsulates the barcode scanning feature in one reusable composable. This component handles camera access, barcode detection, and visual overlays out of the box.
Integration
For an example of a complete integration of the Kotlin Multiplatform Barcode Scanner, please refer to our scanbot-barcode-scanner-sdk-example-kmp repository on GitHub.
Adding the feature as a dependency
To use BarcodeScannerCustomUI, add the Scanbot Compose UI dependency to your KMP project:
commonMain.dependencies {
implementation("io.scanbot:kmp-compose-ui-barcode-sdk:$scanbotSdkVersion")
}
Initializing the SDK
Before using the Scanbot SDK, it must be initialized in your application. For more details on how to initialize the SDK, please refer to the initialization guide.
Using BarcodeScannerCustomUI
To start using the barcode scanner, add the BarcodeScannerCustomUI composable to your screen:
loading...
Main configuration
The Scanbot SDK provides the ability to configure the barcode scanner through BarcodeScannerCustomUI configurations and BarcodeScannerConfiguration. There are two ways of doing this: simplified and advanced.
Simple configuration
Here is an example of a simple configuration modification:
loading...
It provides a straightforward way to configure barcodeFormatConfigurations, extractedDocumentFormats, and onlyAcceptDocuments.
Advanced configuration
For more detailed configuration, you can use the advanced way:
loading...
For the full list of parameters, please refer to the BarcodeScannerConfiguration.
Common configuration
Some use cases require special handling. For example, it is possible to configure the barcode scanner to scan only barcodes of pre-defined lengths. This might reduce the number of false scans. Such parameters work only for enumerated types of barcodes and usually you don't need to modify their default values.
You can specify these parameters via the BarcodeFormatCommonConfiguration entity as a part of BarcodeScannerConfiguration:
loading...
For the full list of parameters, please refer to the BarcodeScannerConfiguration.
Camera configuration
loading...
For the full list of parameters, please refer to the BarcodeCameraConfiguration.
Finder view configuration
Customize the finder overlay appearance and behavior:
loading...
For the full list of parameters, please refer to the FinderViewConfiguration.
AR Overlay configuration
Add visual overlays to detected barcodes with AR-style highlighting:
loading...
For the full list of parameters, please refer to the ArOverlayConfiguration.
Custom overlay for individual barcodes
Customize the overlay for each barcode individually.
loading...
Handling scan results
loading...
Want to scan longer than one minute?
Generate a free trial license to test the Scanbot SDK thoroughly.
Get free trial licenseScanbot SDK is part of the Apryse SDK product family
A mobile scan is just the start. With Apryse SDKs, you can expand mobile workflows into full cross‑platform document processing. Whether you need to edit PDFs, add secure digital signatures, or use a fast, customizable document viewer and editor, Apryse gives you the tools to build powerful features quickly.
Learn more
