Table of Contents

Interface IScanbotSDKService

Namespace
ScanbotSDK.MAUI
Assembly
DocumentSDK.MAUI.dll

Async API wrapper interface for SDK functions.

public interface IScanbotSDKService

Properties

DefaultOcrConfig

Returns information about the installed OCR languages.

OcrConfig DefaultOcrConfig { get; }

Property Value

OcrConfig

IsEncryptionEnabled

Returns whether the encryption was enabled.

bool IsEncryptionEnabled { get; }

Property Value

bool

true if the encryption was set during initialisation of the SDK; otherwise, false.

IsLicenseValid

Returns whether the installed license is valid. If the SDK was initialized without a license, trial mode will be enabled and the license will remain valid for about a minute.

bool IsLicenseValid { get; }

Property Value

bool

true if the license is valid; otherwise, false.

LicenseInfo

Returns the License info.

LicenseInfo LicenseInfo { get; }

Property Value

LicenseInfo

Methods

ApplyImageFilterAsync(ImageSource, ParametricFilter, ResultOptions)

Applies the filters to an ImageSource asynchronously.

Task<FileImageSource> ApplyImageFilterAsync(ImageSource image, ParametricFilter filter, ResultOptions resultOptions = null)

Parameters

image ImageSource

Image.

filter ParametricFilter

Filters.

resultOptions ResultOptions

Result options that specify the result image's storage details.

Returns

Task<FileImageSource>

The image with the applied filters.

CleanUp()

Removes all internally generated files from methods of this interface, as well as all page image files.

Task CleanUp()

Returns

Task

CreatePdfAsync(IEnumerable<FileImageSource>, PDFConfiguration)

Creates a PDF file out of one or more FileImageSource objects. All images must be instances of FileImageSource. Those are images created with ImageSource.FromStream and images stored as files by the SDK (which is the default behavior, corresponds to ResultStorage.File). The generated file will be deleted when calling CleanUp. If you want to keep the file, move it to a folder that you have control over.

Task<Uri> CreatePdfAsync(IEnumerable<FileImageSource> files, PDFConfiguration configuration)

Parameters

files IEnumerable<FileImageSource>

A collection of FileImageSource instances.

configuration PDFConfiguration

Contains the PDF configurations and PDF metadata.

Returns

Task<Uri>

The path to the created file.

CreateSandwichPdfAsync(IEnumerable<FileImageSource>, PDFConfiguration, OcrConfig)

Performs OCR and Creates a PDF file out of one or more FileImageSource objects. All images must be instances of FileImageSource. Those are images created with ImageSource.FromStream and images stored as files by the SDK (which is the default behavior, corresponds to ResultStorage.File). The generated file will be deleted when calling CleanUp. If you want to keep the file, move it to a folder that you have control over.

Task<Uri> CreateSandwichPdfAsync(IEnumerable<FileImageSource> sources, PDFConfiguration pdfConfig, OcrConfig ocrConfig)

Parameters

sources IEnumerable<FileImageSource>

Images containing text.

pdfConfig PDFConfiguration

Contains the PDF configurations and PDF metadata.

ocrConfig OcrConfig

The OCR configuration. If the value is not set, The default value used will be [OCRMode.ScanbotOCR] which is the new ML based configuration. The langauges string is mandatory only if we use the old [Tessarat] based engine.

Returns

Task<Uri>

The result of OCR, containing the recognized text and text structure information.

CreateScannedPageAsync(ImageSource)

Creates a ScannedPage object from an ImageSource. Used when you need to pass an ImageSource to CroppingPage

Task<IScannedPage> CreateScannedPageAsync(ImageSource source)

Parameters

source ImageSource

Image to use as original

Returns

Task<IScannedPage>

The scanned page.

DetectDocumentQualityAsync(ImageSource, DocumentQualityAnalyzerConfiguration)

Detects the quality of the document image.

Task<DocumentQuality> DetectDocumentQualityAsync(ImageSource source, DocumentQualityAnalyzerConfiguration configuration = null)

Parameters

source ImageSource

The document image source.

configuration DocumentQualityAnalyzerConfiguration

Configure the properties for analyzing quality of the image. Optional.

Returns

Task<DocumentQuality>

GetAllPagesAsync()

Returns all scanned pages currently in persistent storage.

Task<IReadOnlyCollection<IScannedPage>> GetAllPagesAsync()

Returns

Task<IReadOnlyCollection<IScannedPage>>

ParseBarcodeDocument(string)

Parses the string into one of the supported document type or returns null if none of the supported document types was detected

Task<GenericDocument> ParseBarcodeDocument(string barcodeText)

Parameters

barcodeText string

Returns

Task<GenericDocument>

PerformOcrAsync(IEnumerable<FileImageSource>, OcrConfig)

Performs OCR on an image.

Task<OcrResult> PerformOcrAsync(IEnumerable<FileImageSource> sources, OcrConfig configuration = null)

Parameters

sources IEnumerable<FileImageSource>

Images containing text.

configuration OcrConfig

The OCR configuration. If the value is not set, The default value used will be [OCRMode.ScanbotOCR] which is the new ML based configuration. The langauges string is mandatory only if we use the old [Tessarat] based engine.

Returns

Task<OcrResult>

The result of OCR, containing the recognized text and text structure information.

ReconstructPage(string, Point[], ParametricFilter[], DocumentDetectionStatus)

Reconstructs the Page object from the pageId and other parameters, received previously in the document detection result.

Task<IScannedPage> ReconstructPage(string id, Point[] polygon, ParametricFilter[] filter, DocumentDetectionStatus status)

Parameters

id string

Page Identifier

polygon Point[]

Polygon of the detected document.

filter ParametricFilter[]

Parametric filters array.

status DocumentDetectionStatus

Detection status of the detected page.

Returns

Task<IScannedPage>

Page object of type IScannedPage.

RefreshImageUris(IEnumerable<IScannedPage>)

Updates the storage directory of existing pages. Required if you storage pages and their image paths locally and the internal storage directory changes. Expects at least one page

Task<IReadOnlyCollection<IScannedPage>> RefreshImageUris(IEnumerable<IScannedPage> pages)

Parameters

pages IEnumerable<IScannedPage>

Returns

Task<IReadOnlyCollection<IScannedPage>>

ResizeImageAsync(ImageSource, int, ResultOptions)

Resizes an image asynchronously.

Task<ImageSource> ResizeImageAsync(ImageSource image, int maxSize, ResultOptions resultOptions = null)

Parameters

image ImageSource

Image to rotate.

maxSize int

The output image max size (the image will be scaled while keeping the aspect ratio; maxSize is the greater length between width and height

resultOptions ResultOptions

Result options that specify the result image's storage details.

Returns

Task<ImageSource>

The rotated image.

RotateImageAsync(ImageSource, double, ResultOptions)

Rotates an image asynchronously.

Task<ImageSource> RotateImageAsync(ImageSource image, double degrees, ResultOptions resultOptions = null)

Parameters

image ImageSource

Image to rotate.

degrees double

Degrees counterclockwise.

resultOptions ResultOptions

Result options that specify the result image's storage details.

Returns

Task<ImageSource>

The rotated image.

WriteTiffAsync(IEnumerable<FileImageSource>, TiffOptions)

Writes the given images into a TIFF file. If more than one image is given, the function creates a multi-page TIFF. The function can optionally create a 1-bit encoded TIFF. The generated file will be deleted when calling CleanUp. If you want to keep the file, move it to a folder that you have control over.

Task<Uri> WriteTiffAsync(IEnumerable<FileImageSource> files, TiffOptions options = null)

Parameters

files IEnumerable<FileImageSource>

A collection of FileImageSource instances.

options TiffOptions

Options.

Returns

Task<Uri>

The path to the created file.