Skip to main content

DocutainSDKPlugin

Main class of the Docutain SDK.

Methods​

initSDK()​

initSDK(options): Promise<void>

Initializes the Docutain SDK. This method needs to be called prior to using any functionality of the Docutain SDK.

Parameters​

ParameterType
optionsInitSDKOptions

Returns​

Promise\<void>

Since​

1.0.0


scanDocument()​

scanDocument(args): Promise<ScanDocumentResult>

Starts the document scanner.

Parameters​

ParameterType
argsobject
args.configStartDocumentScannerOptions

Returns​

Promise\<ScanDocumentResult>

Deprecated​

Use startDocumentScanner() to start the document scanner.

Since​

1.0.0


startDocumentScanner()​

startDocumentScanner(options): Promise<void>

Starts the document scanner.

Parameters​

ParameterType
optionsStartDocumentScannerOptions

Returns​

Promise\<void>

Since​

6.0.0


loadFile()​

loadFile(options): Promise<void>

Loads a file from the given path.

Parameters​

ParameterType
optionsLoadFileOptions

Returns​

Promise\<void>

Since​

1.0.0


getText()​

getText(): Promise<GetTextResult>

Detects the text of the currently loaded document and returns it.

Returns​

Promise\<GetTextResult>

Since​

1.0.0


getTextPage()​

getTextPage(options): Promise<GetTextPageResult>

Detects the text of the currently loaded document page and returns it.

Parameters​

ParameterType
optionsGetTextPageOptions

Returns​

Promise\<GetTextPageResult>

Since​

1.0.0


setAnalyzeConfiguration()​

setAnalyzeConfiguration(args): Promise<void>

This method sets the analyze configuration.

Parameters​

ParameterType
argsobject
args.configAnalyzeConfiguration

Returns​

Promise\<void>

Deprecated​

Use setAnalyzeConfigurationDocScan() to sets the analyze configuration.

Since​

1.0.0


setAnalyzeConfigurationDocScan()​

setAnalyzeConfigurationDocScan(options): Promise<void>

This method sets the analyze configuration.

Parameters​

ParameterType
optionsAnalyzeConfigurationOptions

Returns​

Promise\<void>

Since​

1.0.0


analyze()​

analyze(): Promise<AnalyzeResult>

This method get the detected data.

Returns​

Promise\<AnalyzeResult>

Since​

1.0.0


writePDF()​

writePDF(options): Promise<WritePDFResult>

This method generates a PDF document from the loaded or scanned pages.

Parameters​

ParameterType
optionsWritePDFOptions

Returns​

Promise\<WritePDFResult>

Since​

1.0.0


setLogLevel()​

setLogLevel(options): Promise<void>

This method sets the log level, which determines the severity of the message.

Parameters​

ParameterType
optionsSetLogLevelOptions

Returns​

Promise\<void>

Since​

1.0.0


getTraceFile()​

getTraceFile(): Promise<GetTraceFileResult>

This method returns the Trace file which includes logging and error messages.

Returns​

Promise\<GetTraceFileResult>

Since​

1.0.0


deleteTempFiles()​

deleteTempFiles(options): Promise<void>

This method deletes all temporary files created by the Docutain SDK.

Parameters​

ParameterType
optionsDeleteTempFilesOptions

Returns​

Promise\<void>

Since​

1.0.0


writeImage()​

writeImage(options): Promise<WriteImageResult>

This method generates a JPG from the loaded or scanned page and saves it to a local file.

Parameters​

ParameterType
optionsWriteImageOptions

Returns​

Promise\<WriteImageResult>

Since​

1.0.0


getImageBytes()​

getImageBytes(options): Promise<GetImageBytesResult>

This method generates a JPG from the loaded or scanned page and returns it as a base64 encoded string.

Parameters​

ParameterType
optionsGetImageBytesOptions

Returns​

Promise\<GetImageBytesResult>

Since​

1.0.0


pageCount()​

pageCount(): Promise<PageCountResult>

This method returns the page count of the currently loaded document.

Returns​

Promise\<PageCountResult>

Since​

1.0.0


resetOnboarding()​

resetOnboarding(options): Promise<void>

Resets onboarding state.

Parameters​

ParameterType
optionsResetOnboardingOptions

Returns​

Promise\<void>

Since​

1.0.0


onboardingDefaultItems()​

onboardingDefaultItems(): Promise<OnboardingDefaultItemsResult>

Gets the default onboarding items.

Returns​

Promise\<OnboardingDefaultItemsResult>

Since​

1.0.0


scanTipsDefaultItems()​

scanTipsDefaultItems(): Promise<ScanTipsDefaultItemsResult>

Gets the default scan tips items.

Returns​

Promise\<ScanTipsDefaultItemsResult>

Since​

1.0.0


startPhotoPayment()​

startPhotoPayment(options): Promise<StartPhotoPaymentResult>

Starts the photo payment process.

Parameters​

ParameterType
optionsStartPhotoPaymentOptions

Returns​

Promise\<StartPhotoPaymentResult>

Since​

1.0.0


emptyResultScreenDefaultItems()​

emptyResultScreenDefaultItems(): Promise<EmptyResultScreenDefaultItemsResult>

Gets the default empty result screen items.

Returns​

Promise\<EmptyResultScreenDefaultItemsResult>

Since​

1.0.0