Simple scanner guide

Introduction

The scan flow consists of two screens that enable the user to capture and validate each page of its document:

  • a camera screen to scan the document
  • a screen where the user validates the scanned document and can optionally adjust the crop area, the filters.

If the multi-page mode is enabled, the user will repeat this interaction until they validate their batch of scan on the camera screen.

Camera screen
Review screen
Recrop screen

In this guide, you will learn how to integrate this simple scan flow with a couple of lines of code.

Prerequisites

This guide assumes that you have followed the Getting Started guide :

  • You have integrated the gssdk-core and gssdk-scanflow libraries in your app with Gradle.
  • You have initialized the SDK with the license key.

Start the scan flow

You configure the scan flow with a configuration object, which lets you configure features such as:

  • Source: capture from the camera or import an existing image from the device’s photo library
  • Camera flash mode: you can force the flash to be always on, or only enable it on demand.
  • Multi-page mode: can be enabled or disabled.
  • PDF page size and resolution.
  • Available actions in the post-processing screen.
  • Background and text colors of the different screens.

All these parameters are extensively documented in the Android API documentation.

Once the user finishes their scan session, the scan flow returns the scanned pages’ list as images and a PDF file combining all the pages.

Kotlin
val scanConfiguration = ScanConfiguration().apply {
  multiPage = true
}
ScanFlow.scanWithConfiguration(context, scanConfiguration)
Java
ScanConfiguration scanConfiguration = new ScanConfiguration();
scanConfiguration.multiPage = true;
ScanFlow.scanWithConfiguration(context, scanConfiguration);

and… that’s it!

© 2020 The Grizzly Labs, Inc. All rights reserved.