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
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
Methods
ApplyImageFilterAsync(ImageSource, ParametricFilter, ResultOptions)
Applies the filters to an ImageSource asynchronously.
Task<FileImageSource> ApplyImageFilterAsync(ImageSource image, ParametricFilter filter, ResultOptions resultOptions = null)
Parameters
image
ImageSourceImage.
filter
ParametricFilterFilters.
resultOptions
ResultOptionsResult 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
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
PDFConfigurationContains the PDF configurations and PDF metadata.
Returns
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
PDFConfigurationContains the PDF configurations and PDF metadata.
ocrConfig
OcrConfigThe 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
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
ImageSourceImage 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
ImageSourceThe document image source.
configuration
DocumentQualityAnalyzerConfigurationConfigure the properties for analyzing quality of the image. Optional.
Returns
GetAllPagesAsync()
Returns all scanned pages currently in persistent storage.
Task<IReadOnlyCollection<IScannedPage>> GetAllPagesAsync()
Returns
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
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
OcrConfigThe 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
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
stringPage Identifier
polygon
Point[]Polygon of the detected document.
filter
ParametricFilter[]Parametric filters array.
status
DocumentDetectionStatusDetection 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
ResizeImageAsync(ImageSource, int, ResultOptions)
Resizes an image asynchronously.
Task<ImageSource> ResizeImageAsync(ImageSource image, int maxSize, ResultOptions resultOptions = null)
Parameters
image
ImageSourceImage to rotate.
maxSize
intThe output image max size (the image will be scaled while keeping the aspect ratio; maxSize is the greater length between width and height
resultOptions
ResultOptionsResult 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
ImageSourceImage to rotate.
degrees
doubleDegrees counterclockwise.
resultOptions
ResultOptionsResult 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
TiffOptionsOptions.