Interface IScanbotOperations
- Namespace
- ScanbotSDK.MAUI
- Assembly
- DocumentSDK.MAUI.dll
Async API wrapper interface for SDK functions.
public interface IScanbotOperations
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
trueif 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
trueif the license is valid; otherwise,false.
LicenseInfo
Returns the License info.
LicenseInfo LicenseInfo { get; }
Property Value
Methods
ApplyImageFilterAsync(PlatformImage, ParametricFilter, ResultOptions)
Applies the filters to an ImageSource asynchronously.
[Obsolete("This method may be moved to ImageProcessor or a related extension class in the future")]
Task<PlatformImage> ApplyImageFilterAsync(PlatformImage image, ParametricFilter filter, ResultOptions resultOptions = null)
Parameters
imagePlatformImageImage.
filterParametricFilterFilters.
resultOptionsResultOptionsResult options that specify the result image's storage details.
Returns
- Task<PlatformImage>
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
filesIEnumerable<FileImageSource>A collection of FileImageSource instances.
configurationPDFConfigurationContains 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
sourcesIEnumerable<FileImageSource>Images containing text.
pdfConfigPDFConfigurationContains the PDF configurations and PDF metadata.
ocrConfigOcrConfigThe 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(PlatformImage)
Creates a ScannedPage object from an ImageSource. Used when you need to pass an ImageSource to CroppingPage
[Obsolete("This makes use of the legacy page storage feature. Prefer to use the new ScannedDocument and ScannedPage classes and related APIs.")]
Task<IScannedPage> CreateScannedPageAsync(PlatformImage source)
Parameters
sourcePlatformImageImage to use as original
Returns
- Task<IScannedPage>
The scanned page.
DetectDocumentQualityAsync(PlatformImage, DocumentQualityAnalyzerConfiguration)
Detects the quality of the document image.
Task<DocumentQuality> DetectDocumentQualityAsync(PlatformImage image, DocumentQualityAnalyzerConfiguration configuration = null)
Parameters
imagePlatformImageconfigurationDocumentQualityAnalyzerConfigurationConfigure the properties for analyzing quality of the image. Optional.
Returns
GetAllPagesAsync()
Returns all scanned pages currently in persistent storage.
[Obsolete("This makes use of the legacy page storage feature. Prefer to use the new ScannedDocument and ScannedPage classes and related APIs.")]
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
barcodeTextstring
Returns
PerformOcrAsync(IEnumerable<FileImageSource>, OcrConfig)
Performs OCR on an image.
Task<OcrResult> PerformOcrAsync(IEnumerable<FileImageSource> sources, OcrConfig configuration = null)
Parameters
sourcesIEnumerable<FileImageSource>Images containing text.
configurationOcrConfigThe 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, PointF[], ParametricFilter[], DocumentDetectionStatus)
Reconstructs the Page object from the pageId and other parameters, received previously in the document detection result.
[Obsolete("This makes use of the legacy page storage feature. Prefer to use the new ScannedDocument and ScannedPage classes and related APIs.")]
Task<IScannedPage> ReconstructPage(string id, PointF[] polygon, ParametricFilter[] filter, DocumentDetectionStatus status)
Parameters
idstringPage Identifier
polygonPointF[]Polygon of the detected document.
filterParametricFilter[]Parametric filters array.
statusDocumentDetectionStatusDetection 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
[Obsolete("This makes use of the legacy page storage feature. Prefer to use the new ScannedDocument and ScannedPage classes and related APIs.")]
Task<IReadOnlyCollection<IScannedPage>> RefreshImageUris(IEnumerable<IScannedPage> pages)
Parameters
pagesIEnumerable<IScannedPage>
Returns
ResizeImageAsync(ImageSource, int, ResultOptions)
Resizes an image asynchronously.
[Obsolete("This method may be updated to use PlatformImage or moved to ImageProcessor in the future")]
Task<ImageSource> ResizeImageAsync(ImageSource image, int maxSize, ResultOptions resultOptions = null)
Parameters
imageImageSourceImage to rotate.
maxSizeintThe output image max size (the image will be scaled while keeping the aspect ratio; maxSize is the greater length between width and height
resultOptionsResultOptionsResult options that specify the result image's storage details.
Returns
- Task<ImageSource>
The rotated image.
RotateImageAsync(ImageSource, double, ResultOptions)
Rotates an image asynchronously.
[Obsolete("This method may be updated to use PlatformImage or moved to ImageProcessor in the future")]
Task<ImageSource> RotateImageAsync(ImageSource image, double degrees, ResultOptions resultOptions = null)
Parameters
imageImageSourceImage to rotate.
degreesdoubleDegrees counterclockwise.
resultOptionsResultOptionsResult 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
filesIEnumerable<FileImageSource>A collection of FileImageSource instances.
optionsTiffOptionsOptions.