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 classScanbotSDKInitializer.PrepareBlobsTaskpublic classScanbotSDKInitializer.Companion
-
Field Summary
Fields Modifier and Type Field Description public final static ScanbotSDKInitializer.CompanionCompanion
-
Constructor Summary
Constructors Constructor Description ScanbotSDKInitializer()
-
Method Summary
Modifier and Type Method Description ScanbotSDKInitializerwithLogging(Boolean useLog, Boolean enableNativeLogging)Enables or disables logs in Scanbot SDK. final ScanbotSDKInitializerlicense(Application application, String license)Set Scanbot SDK license final ScanbotSDKInitializerlicenceErrorHandler(IScanbotSDKLicenseErrorHandler licenseErrorHandler)Register callback for handling all sdk license errors after sdk initialisation final ScanbotSDKInitializerocrBlobsPath(Application application, String ocrBlobsPath)Set Scanbot SDK OCR blobs path final ScanbotSDKInitializerprepareOCRLanguagesBlobs(Boolean prepareOCRLanguagesBlobs)Set Scanbot SDK to prepare OCR languages blobs. final ScanbotSDKInitializeruseOcrSettings(OcrSettings ocrSettings)Set Scanbot SDK to use given OCR settings final ScanbotSDKInitializerdocumentScannerEngineMode(DocumentScannerEngineMode type)Set Scanbot SDK to use the specified DocumentScannerEngineModeDefault is DocumentScannerEngineMode.ML. final ScanbotSDKInitializeruseFileEncryption(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 ScanbotSDKInitializerallowXnnpackAcceleration(Boolean enable)Enables/disables XNNPACK acceleration for TensorFlow ML models, which provides highly optimized implementations of floating-point neural network operators. ScanbotSDKInitializeruseCameraXRtuUi(Boolean enable)Controls whether the new Camera X based View will be used in Ready to Use UI components. final ScanbotSDKInitializerallowGpuAcceleration(Boolean enable)Enables/disables GPU acceleration for TensorFlow ML models final ScanbotSDKInitializerprecompileGpuMlModels(Function0<Unit> precompilingCallback)Performs GPU ML models precompiling final ScanbotSDKInitializerpdfImagesExtractorType(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. SdkLicenseInfoinitialize(Application application)Initializes Scanbot SDK library. final ScanbotSDKInitializerdocumentDraftExtractor(DocumentDraftExtractor extractor)Adjust this parameter to specify snapped pages should be combined into documents and in which format final ScanbotSDKInitializersdkFilesDirectory(Application application, File sdkFilesDirectory)Set the custom directory for pages and documents storage ScanbotSDKInitializerlogger(Logger logger)Adjust this parameter to specify which Logger should be used. final ScanbotSDKInitializerusePageStorageSettings(PageStorageSettings pageStorageSettings)Adjust this parameter to specify which io.scanbot.sdk.persistence. static BooleanisInitialized()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-trueto enable logging,falseto disable loggingenableNativeLogging- settrueif 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.mcscanner.MedicalCertificateScanner and io.scanbot.sdk.hicscanner.HealthInsuranceCardScanner
-
useOcrSettings
final ScanbotSDKInitializer useOcrSettings(OcrSettings ocrSettings)
Set Scanbot SDK to use given OCR settings
-
documentScannerEngineMode
final ScanbotSDKInitializer documentScannerEngineMode(DocumentScannerEngineMode type)
Set Scanbot SDK to use the specified DocumentScannerEngineMode
Default is DocumentScannerEngineMode.ML.
Use io.scanbot.sdk.ScanbotSDK.createDocumentScanner to get an instance of DocumentScanner
-
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.
trueby 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.
-
-
-
-