Skip to main content

Capacitor Document Scanner SDK - Getting Started

To get started with the integration of the Scanbot SDK Capacitor Plugin in your project please follow this guide and check out our example projects.

Example Projects

Check out our example project on GitHub:

Installation

The Scanbot SDK Capacitor Plugin is available as NPM package capacitor-plugin-scanbot-sdk. You can simply install and add it to your Capacitor project with the following command:

npm install capacitor-plugin-scanbot-sdk

And sync your project with:

npx cap sync

Android: Tuning the AndroidManifest.xml

Since your application will work with high-resolution images, it is strongly recommended to add the attribute android:largeHeap="true" in the <application> element of your AndroidManifest.xml file, especially for Android <= v7.x. Processing hi-res images is a memory intensive task and this property will ensure your app has enough heap allocated to avoid OutOfMemoryError exceptions.

<application android:largeHeap="true"/>

Permissions

If you are going to use any of our features that require the usage of the device's camera, you must grant camera permission in your AndroidManifest.xml file (for Android) and Info.plist (for iOS).

AndroidManifest.xml

Add the following line:

<uses-permission android:name="android.permission.CAMERA" />

Info.plist

Add the key:

  • NSCameraUsageDescription - "Privacy - Camera Usage Description".

And describe why your app wants to access the camera.

Imports

import { ScanbotSDK } from 'capacitor-plugin-scanbot-sdk';

// Other imports
import {
BarcodeResult,
CroppingResult,
...
} from 'capacitor-plugin-scanbot-sdk';

Want to scan longer than one minute?

Generate your free "no-strings-attached" Trial License and properly test the Scanbot SDK.

Get your free Trial License

What do you think of this documentation?