ALOCRScanPlugin Class Reference

Inherits from ALAbstractScanPlugin : NSObject
Declared in ALOCRScanPlugin.h

Overview

The ALOCRScanPlugin can be used to recognize text. It can be adapted to different kinds of use cases with the {@link ALOOCRConfig} (settings to adapt the recognition to your use case).

– initWithPluginID:licenseKey:delegate:ocrConfig:error:

Constructor for the ALOCRScanPlugin

- (instancetype _Nullable)initWithPluginID:(NSString *_Nullable)pluginID licenseKey:(NSString *_Nonnull)licenseKey delegate:(id<ALOCRScanPluginDelegate> _Nonnull)delegate ocrConfig:(ALOCRConfig *_Nonnull)ocrConfig error:(NSError *_Nullable *_Nullable)error

Parameters

pluginID

An unique pluginID

licenseKey

The Anyline license key

delegate

The delegate which receives the results

ocrConfig

The OCRConfig to configure your use-case

error

The Error object if something fails

Return Value

Boolean indicating the success / failure of the call.

Declared In

ALOCRScanPlugin.h

– init

- (instancetype _Nullable)init

  delegates

@property (nonatomic, strong, readonly) NSHashTable<ALOCRScanPluginDelegate> *delegates

  ocrConfig

Read-only property for the ALOCRConfig

@property (nullable, nonatomic, strong, readonly) ALOCRConfig *ocrConfig

Discussion

Use method setOCRConfig:error: for setting the config.

Declared In

ALOCRScanPlugin.h

– setOCRConfig:error:

Sets a new ALOCRConfig and returns an Error if something failed.

- (BOOL)setOCRConfig:(ALOCRConfig *_Nonnull)ocrConfig error:(NSError *_Nullable *_Nullable)error

Parameters

ocrConfig

The ALOCRConfig to set

error

The Error object if something fails

Return Value

Boolean indicating the success / failure of the call.

Declared In

ALOCRScanPlugin.h

– copyTrainedData:fileHash:error:

Use this method to copy a custom trained font data into the Anyline work environment. This method is mandatory if you want to use custom fonts.

- (BOOL)copyTrainedData:(NSString *_Nonnull)trainedDataPath fileHash:(NSString *_Nullable)hash error:(NSError *_Nullable *_Nullable)error

Parameters

trainedDataPath

The full path to your trained data file

error

The Error object if something fails

fileHash

The hash of the traineddata file so Anyline knows when it changed.

Return Value

Boolean indicating the success / failure of the call.

Declared In

ALOCRScanPlugin.h

– addDelegate:

- (void)addDelegate:(id<ALOCRScanPluginDelegate> _Nonnull)delegate

– removeDelegate:

- (void)removeDelegate:(id<ALOCRScanPluginDelegate> _Nonnull)delegate