ScanConfiguration

data class ScanConfiguration(var source: ScanConfiguration.Source = Source.CAMERA, var sourceImage: File? = null, var multiPage: Boolean = true, var defaultFilter: ScanConfiguration.Filter = Filter.AUTOMATIC, var availableFilters: List<ScanConfiguration.Filter> = listOf( Filter.NONE, Filter.AUTOMATIC, Filter.AUTOMATIC_MONOCHROME, Filter.AUTOMATIC_BLACK_AND_WHITE, Filter.AUTOMATIC_COLOR, Filter.PHOTO ), var pdfPageSize: ScanConfiguration.PdfPageSize = PdfPageSize.FIT, var postProcessingActions: EnumSet<ScanConfiguration.Action> = Action.ALL, var defaultCurvatureCorrection: ScanConfiguration.CurvatureCorrectionMode = CurvatureCorrectionMode.DISABLED, var photoLibraryButtonHidden: Boolean = false, var flashButtonHidden: Boolean = false, var defaultFlashMode: ScanConfiguration.FlashMode = FlashMode.OFF, var backgroundColor: Int = Color.BLACK, var foregroundColor: Int = Color.WHITE, var highlightColor: Int = Color.BLUE, var jpegQuality: Int = 60, var pdfMaxScanDimension: Int = 0, var multiPageFormat: ScanConfiguration.MultiPageFormat = MultiPageFormat.PDF, var pdfFontFile: File? = null, var ocrConfiguration: ScanConfiguration.OcrConfiguration? = null, var structuredData: EnumSet<ScanConfiguration.StructuredData> = EnumSet.noneOf(StructuredData::class.java), useLegacyCameraAPI: Boolean = false) : Serializable

Options allowing to customize the scan flow

Constructors

Link copied to clipboard
constructor(source: ScanConfiguration.Source = Source.CAMERA, sourceImage: File? = null, multiPage: Boolean = true, defaultFilter: ScanConfiguration.Filter = Filter.AUTOMATIC, availableFilters: List<ScanConfiguration.Filter> = listOf( Filter.NONE, Filter.AUTOMATIC, Filter.AUTOMATIC_MONOCHROME, Filter.AUTOMATIC_BLACK_AND_WHITE, Filter.AUTOMATIC_COLOR, Filter.PHOTO ), pdfPageSize: ScanConfiguration.PdfPageSize = PdfPageSize.FIT, postProcessingActions: EnumSet<ScanConfiguration.Action> = Action.ALL, defaultCurvatureCorrection: ScanConfiguration.CurvatureCorrectionMode = CurvatureCorrectionMode.DISABLED, photoLibraryButtonHidden: Boolean = false, flashButtonHidden: Boolean = false, defaultFlashMode: ScanConfiguration.FlashMode = FlashMode.OFF, backgroundColor: Int = Color.BLACK, foregroundColor: Int = Color.WHITE, highlightColor: Int = Color.BLUE, jpegQuality: Int = 60, pdfMaxScanDimension: Int = 0, multiPageFormat: ScanConfiguration.MultiPageFormat = MultiPageFormat.PDF, pdfFontFile: File? = null, ocrConfiguration: ScanConfiguration.OcrConfiguration? = null, structuredData: EnumSet<ScanConfiguration.StructuredData> = EnumSet.noneOf(StructuredData::class.java), useLegacyCameraAPI: Boolean = false)

Types

Link copied to clipboard

Actions displayed on the post processing screen

Link copied to clipboard

The post processing filter to apply to the image.

Link copied to clipboard
Link copied to clipboard
data class OcrConfiguration(var languages: List<String>? = null, var outputFormats: EnumSet<ScanConfiguration.OcrOutputFormat> = OcrOutputFormat.ALL) : Serializable
Link copied to clipboard

The various formats into which the OCR result can be made available.

Link copied to clipboard

Physical size of pages in the generated PDF file

Link copied to clipboard

The source of the scan flow.

Link copied to clipboard

The types of structured data to extract.

Properties

Link copied to clipboard

The filters that the user can select when they tap on the edit filter button.

Link copied to clipboard

UI background color. Default is black.

Link copied to clipboard

Any specific kind of post-processing to use. Defaults to automatic.

Link copied to clipboard

The default flash mode used when capturing a page. Combine with ScanConfiguration.flashButtonHidden if you want to only allow a specific flash mode. Default is FlashMode.OFF.

Link copied to clipboard

The visibility of the flash button. By default, the flash button is displayed.

Link copied to clipboard

UI foreground color (text and icons). Default is white.

Link copied to clipboard

Color of the document detection overlay. Default is blue.

Link copied to clipboard

JPEG quality used to compress captured images. Between 0 and 100, 100 being the best quality. Default is 60.

Link copied to clipboard

Multipage mode. Only apply when ScanConfiguration.source is Source.CAMERA. Defaults to true.

Link copied to clipboard

Format of the document created with all the captured pages. When set to MultiPageFormat.NONE, no document will be generated but the individual pages will still be accessible in the ScanResult.

Link copied to clipboard

Configuration of the text recognition. Text recognition will run on a background thread for every captured image. If null, no text recognition will be applied.

Link copied to clipboard

Custom font file used during the PDF generation to embed an invisible text layer. If null, a default font is used, which only supports Latin languages.

Link copied to clipboard

Max scan dimension in pixels when generating the PDF file. All scans included in the PDF file will be scaled so that both their height and width are smaller than this value, while keeping their aspect ratio. Default is 0, which means no scaling is applied.

Link copied to clipboard

Determine the size of the pages when generating the PDF. Default is PdfPageSize.FIT

Link copied to clipboard

The visibility of the photo library button. By default, the photo library button is displayed.

Link copied to clipboard

Select which actions are displayed in the post processing screen Default is everything.

Link copied to clipboard

The source for the scanned documents (camera, image...). If the source is Source.IMAGE, the parameter ScanConfiguration.sourceImage must be provided.

Link copied to clipboard
Link copied to clipboard

Types of structured data to extract from the document. When set to empty, no structured data will be extracted. This is an option set so you can combine multiple values.