### Install Cordova Barcode Scanner Plugin Source: https://docs.scanbot.io/cordova/barcode-scanner-sdk/getting-started Installs the Scanbot Barcode Scanner SDK Cordova Plugin using npm. This command adds the plugin to your Cordova or Ionic project. ```bash $ cordova plugin add cordova-plugin-scanbot-barcode-scanner ``` ```bash $ionic cordova plugin add cordova-plugin-scanbot-barcode-scanner ``` -------------------------------- ### Configure Introduction Screen (.NET Android) Source: https://docs.scanbot.io/maui/document-scanner-sdk/sdk-features/document-data-extractor/ready-to-use-ui Provides an example of configuring the Introduction Screen for the Document Data Extractor on Android using .NET. It shows how to set up the screen's appearance, including background color, title, and image options, and initiates the scanning process. ```csharp using Android.Content; using AndroidX.AppCompat.App; using IO.Scanbot.Sdk.Ui_v2.Common; using IO.Scanbot.Sdk.Ui_v2.Documentdata; using IO.Scanbot.Sdk.Ui_v2.Documentdataextractor.Configuration; using IO.Scanbot.Sdk.UI.View.Base; namespace ScanbotSdkExample.Droid.Snippets.DocumentDataExtractor; public class IntroductionSnippet : AppCompatActivity { private IO.Scanbot.Sdk.ScanbotSDK _scanbotSdk; private const int ScanDocumentDataExtractorRequestCode = 001; protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Returns the singleton instance of the Sdk. _scanbotSdk = new IO.Scanbot.Sdk.ScanbotSDK(this); if (_scanbotSdk.LicenseInfo.IsValid) { LaunchDocumentDataExtractor(); } } private void LaunchDocumentDataExtractor() { // Create the default configuration object. var configuration = new DocumentDataExtractorScreenConfiguration(); // Retrieve the instance of the intro screen from the configuration object. var introScreen = configuration.IntroScreen; introScreen.ShowAutomatically = true; // Configure the background color of the screen. introScreen.BackgroundColor = new ScanbotColor("#FFFFFF"); // Configure the title for the intro screen. introScreen.Title.Text = "How to scan a DE Id Card"; // Configure the image for the introduction screen. // If you want to have no image... introScreen.Image = new DocumentDataIntroNoImage(); // For a custom image... ``` -------------------------------- ### Install Cordova Scanbot SDK Plugin Source: https://docs.scanbot.io/cordova/document-scanner-sdk/getting-started Installs the Scanbot SDK Cordova Plugin using NPM. This command adds the plugin to your Cordova project, enabling document scanning functionalities. ```bash cordova plugin add cordova-plugin-scanbot-sdk ``` ```bash ionic cordova plugin add cordova-plugin-scanbot-sdk ``` -------------------------------- ### Configure Introduction Screen (.NET MAUI) Source: https://docs.scanbot.io/maui/document-scanner-sdk/sdk-features/document-data-extractor/ready-to-use-ui Demonstrates how to configure the Introduction Screen for the Document Data Extractor in .NET MAUI. This includes setting automatic display, background color, title, custom images, handler and divider colors, explanation text, and the done button. It also shows how to launch the extractor and process the results. ```csharp using ScanbotSDK.MAUI; using ScanbotSDK.MAUI.DocumentDataExtractor; namespace ScanbotSdkExample.Maui.Snippets.DocumentDataExtractor; public class IntroductionSnippet { public static async Task LaunchAsync() { // Create the default configuration object. var configuration = new DocumentDataExtractorScreenConfiguration(); // Show the introduction screen automatically when the screen appears. configuration.IntroScreen.ShowAutomatically = true; // Configure the background color of the screen. configuration.IntroScreen.BackgroundColor = new ColorValue("#FFFFFF"); // Configure the title for the intro screen. configuration.IntroScreen.Title.Text = "How to scan a document"; // Configure the image for the introduction screen. configuration.IntroScreen.Image = new DocumentDataIntroNoImage(); // For a custom image... configuration.IntroScreen.Image = new DocumentDataIntroCustomImage { Uri = "PathToImage" }; // Or you can also use our default image. configuration.IntroScreen.Image = new DocumentDataIntroDefaultImage(); // Configure the color of the handler on top. configuration.IntroScreen.HandlerColor = new ColorValue("#EFEFEF"); // Configure the color of the divider. configuration.IntroScreen.DividerColor = new ColorValue("#EFEFEF"); // Configure the text. configuration.IntroScreen.Explanation.Color = new ColorValue("#000000"); configuration.IntroScreen.Explanation.Text = "To quickly and securely scan your document details, please hold your device over the document, so that the camera aligns with all the information on the document.\n\nThe scanner will guide you to the optimal scanning position. Once the scan is complete, your document details will automatically be extracted and processed.\n\nPress 'Start Scanning' to begin."; // Configure the done button. configuration.IntroScreen.DoneButton.Text = "Start Scanning"; configuration.IntroScreen.DoneButton.Background.FillColor = new ColorValue("#C8193C"); // Present the view controller modally. var scannedOutput = await ScanbotSDKMain.Rtu.DocumentDataExtractor.LaunchAsync(configuration); if (scannedOutput.Status != OperationResult.Ok) { // Indicates that cancel was tapped or the result was unsuccessful return; } // Iterate through all the document fields foreach (var field in scannedOutput.Result.Document.Fields) { Console.WriteLine($"{field.Type.Name}: {field.Value.Text}"); } } } ``` -------------------------------- ### Configure Text Pattern Scanner Introduction (.NET Android) Source: https://docs.scanbot.io/maui/document-scanner-sdk/sdk-features/text-pattern-scanner/ready-to-use-ui This snippet demonstrates how to set up the introduction screen for the Text Pattern Scanner on Android using .NET. It covers basic configuration of the intro screen, including setting the background color, title text, and image options. Note that this example shows only a portion of the configuration available. ```csharp using Android.Content; using AndroidX.AppCompat.App; using IO.Scanbot.Sdk.Ui_v2.Common; using IO.Scanbot.Sdk.Ui_v2.Textpattern; using IO.Scanbot.Sdk.Ui_v2.Textpattern.Configuration; using IO.Scanbot.Sdk.UI.View.Base; namespace ScanbotSdkExample.Droid.Snippets.TextPatternScanner; public class IntroductionSnippet : AppCompatActivity { private IO.Scanbot.Sdk.ScanbotSDK _scanbotSdk; private const int ScanTextPatternRequestCode = 001; protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Returns the singleton instance of the Sdk. _scanbotSdk = new IO.Scanbot.Sdk.ScanbotSDK(this); if (_scanbotSdk.LicenseInfo.IsValid) { LaunchTextPatternScanner(); } } private void LaunchTextPatternScanner() { var configuration = new TextPatternScannerScreenConfiguration(); // Configure the intro screen var intro = configuration.IntroScreen; intro.ShowAutomatically = true; intro.BackgroundColor = new ScanbotColor("#FFFFFF"); // Title intro.Title.Text = "How to scan text"; // Image options intro.Image = new TextPatternIntroNoImage(); // intro.Image = new TextPatternIntroCustomImage("PathToImage"); // intro.Image = new TextPatternIntroMeterDevice(); // Only one should be set ``` -------------------------------- ### Install Scanbot SDK via npm, Yarn, or Expo Source: https://docs.scanbot.io/react-native/document-scanner-sdk/quick-start Install the Scanbot SDK module using your preferred package manager. This makes the SDK available for use in your React Native project. ```bash npm install react-native-scanbot-sdk ``` ```bash yarn add react-native-scanbot-sdk ``` ```bash npx expo install react-native-scanbot-sdk ``` -------------------------------- ### Configure Introduction Screen with Kotlin Source: https://docs.scanbot.io/android/document-scanner-sdk/ready-to-use-ui/scanning-flow/introduction-screen Demonstrates how to set up and display a custom introduction screen for the document scanner. This involves creating a DocumentScanningFlow configuration, defining list items with images and styled text, and launching the scanner activity. It highlights setting an automatic display flag, custom images, text colors, and a screen title. ```kotlin import io.scanbot.sdk.ui_v2.common.ScanbotColor import io.scanbot.sdk.ui_v2.common.StyledText import io.scanbot.sdk.ui_v2.document.DocumentScannerActivity import io.scanbot.sdk.ui_v2.document.configuration.DocumentScanningFlow import io.scanbot.sdk.ui_v2.document.configuration.IntroImage import io.scanbot.sdk.ui_v2.document.configuration.IntroListEntry class IntroductionSnippet : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) // In the real application, you should call this function on button click startScanning() } private val context = this private val documentScannerResult: ActivityResultLauncher by lazy { registerForActivityResult(DocumentScannerActivity.ResultContract()) { result -> if (result.resultCode == Activity.RESULT_OK) { result.result?.let { document -> // Handle the document. } } else { // Indicates that the cancel button was tapped. } } } fun startScanning() { // Create the default configuration object. val configuration = DocumentScanningFlow().apply { // Retrieve the instance of the introduction configuration from the main configuration object. screens.camera.introduction.apply { // Show the introduction screen automatically when the screen appears. showAutomatically = true // Create a new introduction item. val firstExampleEntry = IntroListEntry() // Configure the introduction image to be shown. firstExampleEntry.image = IntroImage.receiptsIntroImage() // Configure the text. firstExampleEntry.text = StyledText( text = "Some text explaining how to scan a receipt", color = ScanbotColor(value = "#000000") ) // Create a second introduction item. val secondExampleEntry = IntroListEntry() // Configure the introduction image to be shown. secondExampleEntry.image = IntroImage.checkIntroImage() // Configure the text. secondExampleEntry.text = StyledText( text = "Some text explaining how to scan a check", color = ScanbotColor(value = "#000000") ) // Set the items into the configuration. items = listOf(firstExampleEntry, secondExampleEntry) // Set a screen title. title = StyledText( text = "Introduction", color = ScanbotColor(value = "#000000") ) } } // Start the recognizer activity. documentScannerResult.launch(configuration) } } ``` -------------------------------- ### Start Document Single Page Scanning Source: https://docs.scanbot.io/react-native/document-scanner-sdk/quick-start Initiate the document scanning flow using the `startDocumentScanner` function and the `DocumentScanningFlow` configuration. This example sets the page limit to one and includes basic error handling. ```javascript import { DocumentScanningFlow, startDocumentScanner, } from 'react-native-scanbot-sdk/ui_v2'; async function useSinglePageScanning() { try { /** Create the configuration object for single page scanning */ const configuration = new DocumentScanningFlow(); configuration.outputSettings.pagesScanLimit = 1; /** See further customization configs... */ const documentResult = await startDocumentScanner(configuration); /** Handle the document if the status is 'OK' */ if (documentResult.status === 'OK') { } } catch (e: any) { console.error(e.message); } } ``` -------------------------------- ### Configure and Start Text Pattern Scanner (Swift/Objective-C) Source: https://docs.scanbot.io/maui/document-scanner-sdk/sdk-features/text-pattern-scanner/ready-to-use-ui This example demonstrates how to configure the UI and behavior of the Text Pattern Scanner in iOS. It covers camera settings, UI elements, view finder styles, success overlay, sound, and vibration, before presenting the scanner. ```swift let configuration = SBSDKUI2TextPatternScannerScreenConfiguration() // Configure camera properties. configuration.cameraConfiguration.zoomSteps = [ 1.0, 2.0, 5.0 ] configuration.cameraConfiguration.flashEnabled = false configuration.cameraConfiguration.pinchToZoomEnabled = true // Configure the UI elements like icons or buttons. configuration.topBarOpenIntroScreenButton.visible = true configuration.topBarOpenIntroScreenButton.color = SBSDKUI2Color("#FFFFFF") // Cancel button. configuration.topBar.cancelButton.visible = true configuration.topBar.cancelButton.text = "Cancel" configuration.topBar.cancelButton.foreground.color = SBSDKUI2Color("#FFFFFF") configuration.topBar.cancelButton.background.fillColor = SBSDKUI2Color("#00000000") // Configure the view finder. configuration.viewFinder.aspectRatio = SBSDKAspectRatio(3.85, 1.0) // Configure the style for the view finder. configuration.viewFinder.style = SBSDKUI2FinderStyle.finderStrokedStyle configuration.viewFinder.style = SBSDKUI2FinderStyle.finderCorneredStyle configuration.viewFinder.style = SBSDKUI2FinderCorneredStyle(SBSDKUI2Color("#7A000000"), 3.0, 2.0) // Configure the success overlay. configuration.successOverlay.iconColor = SBSDKUI2Color("#FFFFFF") configuration.successOverlay.message.text = "Scanned Successfully!" configuration.successOverlay.message.color = SBSDKUI2Color("#FFFFFF") // Configure the sound. configuration.sound.successBeepEnabled = true configuration.sound.soundType = SBSDKUI2SoundType.modernBeep // Configure the vibration. configuration.vibration.enabled = false // Present the view controller modally. SBSDKUI2TextPatternScannerViewController.presentOn(self, configuration: configuration) { result in if let result = result { // Handle the result. } else { // Indicates that the cancel button was tapped. } } ``` -------------------------------- ### Launch Barcode Scanner UI Source: https://docs.scanbot.io/web/barcode-scanner-sdk/ready-to-use-ui/how-to-get-started This JavaScript function demonstrates how to launch the RTU UI barcode scanner. It allows for optional configuration and returns the scan results. Ensure you have the 'scanbot-web-sdk' and '@types' packages installed. ```javascript import ScanbotSDK from "scanbot-web-sdk/ui"; import { UIConfig } from "scanbot-web-sdk/@types"; export async function startScanner(config?: UIConfig.BarcodeScannerScreenConfiguration) { // Configure as needed if (!config) { config = new ScanbotSDK.UI.Config.BarcodeScannerScreenConfiguration(); } const result = await ScanbotSDK.UI.createBarcodeScanner(config); // Process & present the result as needed return result; } ``` -------------------------------- ### Prepare and Launch Document Scanner Screen (Kotlin) Source: https://docs.scanbot.io/android/document-scanner-sdk/quick-start Initialize the ActivityResultLauncher in your Activity's onCreate method. Define a callback to handle the result, displaying the first page preview. A button click listener is set up to launch the document scanner using the initialized launcher and a configured DocumentScanningFlow object. ```kotlin override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.quick_start_snippets_activity) // ... // After the super.onCreate(...) and ScanbotSDKInitializer call: // We will use this image view to display the first page preview image, it should exist in your layout xml: val previewImageView = findViewById(R.id.first_page_image_preview) documentScreenLauncher = registerForActivityResultOk(DocumentScannerActivity.ResultContract()) { resultEntity: DocumentScannerActivity.Result -> val result: Document? = resultEntity.result val pages: List? = result?.pages // Display the first page preview image: pages?.get(0)?.let { val previewImage = it.documentPreviewImage previewImageView.setImageBitmap(previewImage) } } // Set up a button to open the document scanner, it should exist in your layout xml: findViewById