Skip to main content

Document Scanner Options

A DocumentScannerOptions object is used to configure the behavior of the document scanner. This interface provides several optional properties that allow you to enable or disable certain features, set the mode of the scanner and choose the format for the results.

PropertyTypeOptionalDescription
pageLimitnumberYesThe maximum number of pages that can be scanned.
galleryImportAllowedbooleanYesAllow the user to choose images from gallery or force a new photograph.
scannerModeScannerModeOptionsYesSets the mode of the scanner.
resultFormatsResultFormatOptionsYesSets the format of the scanned document results.

For more information on these options see the MLKit Docs

Example Usage

const options: DocumentScannerOptions = {
pageLimit: 1,
galleryImportAllowed: false,
scannerMode: ScannerModeOptions.FULL,
resultFormats: ResultFormatOptions.ALL,
};