Class ScanbotSDKInitializer
-
- All Implemented Interfaces:
-
io.scanbot.sdk.ScanbotSdkInitializerCommonApi
,io.scanbot.sdk.SdkInitializer
public final class ScanbotSDKInitializer implements SdkInitializer, ScanbotSdkInitializerCommonApi<ScanbotSDKInitializer>
Initializes Scanbot SDK library. Use it to set up desired components and then call initialize.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
ScanbotSDKInitializer.PrepareBlobsTask
public class
ScanbotSDKInitializer.Companion
-
Field Summary
Fields Modifier and Type Field Description public final static ScanbotSDKInitializer.Companion
Companion
-
Constructor Summary
Constructors Constructor Description ScanbotSDKInitializer()
-
Method Summary
Modifier and Type Method Description ScanbotSDKInitializer
withLogging(Boolean useLog, Boolean enableNativeLogging)
Enables or disables logs in Scanbot SDK. final ScanbotSDKInitializer
license(Application application, String license)
Set Scanbot SDK license final ScanbotSDKInitializer
licenceErrorHandler(IScanbotSDKLicenseErrorHandler licenseErrorHandler)
Register callback for handling all sdk license errors after sdk initialisation final ScanbotSDKInitializer
ocrBlobsPath(Application application, String ocrBlobsPath)
Set Scanbot SDK OCR blobs path final ScanbotSDKInitializer
prepareOCRLanguagesBlobs(Boolean prepareOCRLanguagesBlobs)
Set Scanbot SDK to prepare OCR languages blobs. final ScanbotSDKInitializer
useOcrSettings(OcrSettings ocrSettings)
Set Scanbot SDK to use given OCR settings final ScanbotSDKInitializer
contourDetectorType(ContourDetector.Type type)
Set Scanbot SDK to use the specified io.scanbot.sdk.core.contourdetector.ContourDetector.TypeDefault is io.scanbot.sdk.core.contourdetector.ContourDetector.Type.ML_BASED. final ScanbotSDKInitializer
useFileEncryption(Boolean enableFileEncryption, FileIOProcessor fileIOProcessor)
Sets a global Scanbot SDK flag which enables/disables a usage of encrypted file IO processor for all image and pdf files. final ScanbotSDKInitializer
allowXnnpackAcceleration(Boolean enable)
Enables/disables XNNPACK acceleration for TensorFlow ML models, which provides highly optimized implementations of floating-point neural network operators. ScanbotSDKInitializer
useCameraXRtuUi(Boolean enable)
Controls whether the new Camera X based View will be used in Ready to Use UI components. final ScanbotSDKInitializer
allowGpuAcceleration(Boolean enable)
Enables/disables GPU acceleration for TensorFlow ML models final ScanbotSDKInitializer
precompileGpuMlModels(Function0<Unit> precompilingCallback)
Performs GPU ML models precompiling final ScanbotSDKInitializer
pdfImagesExtractorType(PdfImagesExtractor.Type type)
Set Scanbot SDK to use the specified io.scanbot.sdk.pdf.PdfImagesExtractor.TypeDefault is io.scanbot.sdk.pdf.PdfImagesExtractor.Type.ANDROID_PDF_WRITER. SdkLicenseInfo
initialize(Application application)
Initializes Scanbot SDK library. final ScanbotSDKInitializer
documentDraftExtractor(DocumentDraftExtractor extractor)
Adjust this parameter to specify snapped pages should be combined into documents and in which format final ScanbotSDKInitializer
sdkFilesDirectory(Application application, File sdkFilesDirectory)
Set the custom directory for pages and documents storage ScanbotSDKInitializer
logger(Logger logger)
Adjust this parameter to specify which Logger should be used. final ScanbotSDKInitializer
usePageStorageSettings(PageStorageSettings pageStorageSettings)
Adjust this parameter to specify which io.scanbot.sdk.persistence. static Boolean
isInitialized()
Check if Scanbot SDK was initialized. -
-
Method Detail
-
withLogging
ScanbotSDKInitializer withLogging(Boolean useLog, Boolean enableNativeLogging)
Enables or disables logs in Scanbot SDK.
Logs are printed into LogCat as well as saved on the device. You can find them in Environment.getExternalStorageDirectory
+ /debug_logs/[package_name]
. Usually it is/sdcard/debug_logs/[package_name]
.By default all logs are disabled. If you're using logging, consider switching it off for production builds for security and performance reasons.
This method must be called before .initialize, so it is possible to change logging settings before initializing the SDK.
- Parameters:
useLog
-true
to enable logging,false
to disable loggingenableNativeLogging
- settrue
if logging in C++ native core should be enabled.
-
license
final ScanbotSDKInitializer license(Application application, String license)
Set Scanbot SDK license
-
licenceErrorHandler
final ScanbotSDKInitializer licenceErrorHandler(IScanbotSDKLicenseErrorHandler licenseErrorHandler)
Register callback for handling all sdk license errors after sdk initialisation
-
ocrBlobsPath
final ScanbotSDKInitializer ocrBlobsPath(Application application, String ocrBlobsPath)
Set Scanbot SDK OCR blobs path
-
prepareOCRLanguagesBlobs
final ScanbotSDKInitializer prepareOCRLanguagesBlobs(Boolean prepareOCRLanguagesBlobs)
Set Scanbot SDK to prepare OCR languages blobs. Prepares language train data blobs for io.scanbot.sdk.mcrecognizer.MedicalCertificateRecognizer and io.scanbot.sdk.hicscanner.HealthInsuranceCardScanner
-
useOcrSettings
final ScanbotSDKInitializer useOcrSettings(OcrSettings ocrSettings)
Set Scanbot SDK to use given OCR settings
-
contourDetectorType
final ScanbotSDKInitializer contourDetectorType(ContourDetector.Type type)
Set Scanbot SDK to use the specified io.scanbot.sdk.core.contourdetector.ContourDetector.Type
Default is io.scanbot.sdk.core.contourdetector.ContourDetector.Type.ML_BASED.
Use io.scanbot.sdk.ScanbotSDK.createContourDetector to get an instance of io.scanbot.sdk.core.contourdetector.ContourDetector
-
useFileEncryption
final ScanbotSDKInitializer useFileEncryption(Boolean enableFileEncryption, FileIOProcessor fileIOProcessor)
Sets a global Scanbot SDK flag which enables/disables a usage of encrypted file IO processor for all image and pdf files. By default - false.
-
allowXnnpackAcceleration
final ScanbotSDKInitializer allowXnnpackAcceleration(Boolean enable)
Enables/disables XNNPACK acceleration for TensorFlow ML models, which provides highly optimized implementations of floating-point neural network operators. By default - true.
-
useCameraXRtuUi
ScanbotSDKInitializer useCameraXRtuUi(Boolean enable)
Controls whether the new Camera X based View will be used in Ready to Use UI components.
false
by default.
-
allowGpuAcceleration
final ScanbotSDKInitializer allowGpuAcceleration(Boolean enable)
Enables/disables GPU acceleration for TensorFlow ML models
-
precompileGpuMlModels
final ScanbotSDKInitializer precompileGpuMlModels(Function0<Unit> precompilingCallback)
Performs GPU ML models precompiling
- Parameters:
precompilingCallback
- this callback will be triggered when GPU ML models compilation will be completed
-
pdfImagesExtractorType
final ScanbotSDKInitializer pdfImagesExtractorType(PdfImagesExtractor.Type type)
Set Scanbot SDK to use the specified io.scanbot.sdk.pdf.PdfImagesExtractor.Type
Default is io.scanbot.sdk.pdf.PdfImagesExtractor.Type.ANDROID_PDF_WRITER.
Use io.scanbot.sdk.ScanbotSDK.createPdfImagesExtractor to get an instance of io.scanbot.sdk.pdf.PdfImagesExtractor Or use io.scanbot.sdk.ScanbotSDK.createPdfPagesExtractor to get an instance of io.scanbot.sdk.docprocessing.PdfPagesExtractor
-
initialize
SdkLicenseInfo initialize(Application application)
Initializes Scanbot SDK library. Can be called only once.
-
documentDraftExtractor
final ScanbotSDKInitializer documentDraftExtractor(DocumentDraftExtractor extractor)
Adjust this parameter to specify snapped pages should be combined into documents and in which format
- Parameters:
extractor
- algorithm to extract array of io.scanbot.sdk.entity.DocumentDraft from io.scanbot.sdk.entity.SnappingDraft
-
sdkFilesDirectory
final ScanbotSDKInitializer sdkFilesDirectory(Application application, File sdkFilesDirectory)
Set the custom directory for pages and documents storage
-
logger
ScanbotSDKInitializer logger(Logger logger)
Adjust this parameter to specify which Logger should be used. To set a custom logger withLogging must be set to
true
.- Parameters:
logger
- implementation of Logger.
-
usePageStorageSettings
final ScanbotSDKInitializer usePageStorageSettings(PageStorageSettings pageStorageSettings)
Adjust this parameter to specify which io.scanbot.sdk.persistence.PageStorageSettings should be used.
-
isInitialized
static Boolean isInitialized()
Check if Scanbot SDK was initialized.
-
-
-
-