Document Import Guide

When activating this feature, you can indicate the types of documents the user can choose from:

  • NONE,

  • IMAGES (images only)

  • PDF (PDF files only)

  • PDF_AND_IMAGES (both images and PDF files).

To enable it, pass a DocumentImportEnabledFileTypes enum value to GiniCapture.Builder.setDocumentImportEnabledFileTypes().


Android Manifest

Declare the READ_EXTERNAL_STORAGE permission in your app’s AndroidManifest.xml:

<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="..."> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> </manifest>

When targeting Android 13 and later, also declare the READ_MEDIA_IMAGES permission:

<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="..."> <uses-permission android:name="android.permission.READ_MEDIA_IMAGES" /> </manifest>

If the permission isn’t granted, Gini Capture SDK prompts the user to grant the permission when they use the document import feature.

Declare that your app queries for apps can handle intents to pick or open images and PDF files (Read more about package visibility filtering introduced in Android 11 here):

<queries> <intent> <action android:name="android.intent.action.PICK" /> <data android:mimeType="image/*" /> </intent> <intent> <action android:name="android.intent.action.OPEN_DOCUMENT" /> <data android:mimeType="image/*" /> </intent> <intent> <action android:name="android.intent.action.OPEN_DOCUMENT" /> <data android:mimeType="application/pdf" /> </intent> </queries>

Intercept imported documents

You can intercept the imported document and deny Gini Capture SDK from using it. To do this, subclass the CameraActivity and override the onCheckImportedDocument method. See the reference documentation for details.