Skip to main content

Scanning documents from still images

In addition to detecting documents from a live camera stream, the Document Scanner SDK can scan documents from still images imported from the gallery or any other source.

Initializing the SDK

Before using the Scanbot SDK, it must be initialized.

Processing the image

Obtaining the image

Image picking is platform-specific in KMP. Implement platform-specific logic for Android and iOS, then convert the result to ImageRef.

Scanning documents

Call ScanbotSDK.document.scanFromImage() with the source image and a scanner configuration.

Scan document from image
loading...

Handling the result

ScanbotSDK.document.scanFromImage() returns a sealed Result type with two implementations:

  • Result.Success — contains the DocumentScanningResult with the detection result and cropped document image.
  • Result.Failure — contains the error if the scan could not be completed.

For all available methods, see the Result API reference.

Scan document from image with custom config
loading...

Want to scan longer than one minute?

Generate a free trial license to test the Scanbot SDK thoroughly.

Get free trial license