Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tony-xlh/capacitor-plugin-dynamsoft-label-recognizer

Capacitor plugin of Dynamsoft Label Recognizer
https://github.com/tony-xlh/capacitor-plugin-dynamsoft-label-recognizer

Last synced: 3 months ago
JSON representation

Capacitor plugin of Dynamsoft Label Recognizer

Awesome Lists containing this project

README

        

# capacitor-plugin-dynamsoft-label-recognizer

Capacitor plugin of [Dynamsoft Label Recognizer](https://www.dynamsoft.com/label-recognition/overview/) which brings text recognition ability to your apps.

## Versions

For Capacitor v5, use v1.x.

For Capacitor v4, use v0.x.

## SDK Versions Used for Different Platforms

| Product | Android | iOS | Web |
| ----------- | ----------- | ----------- | ----------- |
| Dynamsoft Label Recognizer | 2.x | 2.x | 2.x |

## Install

```bash
npm install capacitor-plugin-dynamsoft-label-recognizer
npx cap sync
```

## Demo

[Vanilla JS example](https://github.com/tony-xlh/capacitor-plugin-dynamsoft-label-recognizer/tree/main/example)

## API

* [`initialize()`](#initialize)
* [`initLicense(...)`](#initlicense)
* [`recognizeBase64String(...)`](#recognizebase64string)
* [`recognizeBitmap()`](#recognizebitmap)
* [`updateRuntimeSettings(...)`](#updateruntimesettings)
* [`resetRuntimeSettings()`](#resetruntimesettings)
* [`setEngineResourcesPath(...)`](#setengineresourcespath)
* [`addListener('onResourcesLoadStarted', ...)`](#addlisteneronresourcesloadstarted)
* [`addListener('onResourcesLoaded', ...)`](#addlisteneronresourcesloaded)
* [`removeAllListeners()`](#removealllisteners)
* [Interfaces](#interfaces)
* [Type Aliases](#type-aliases)

### initialize()

```typescript
initialize() => Promise
```

--------------------

### initLicense(...)

```typescript
initLicense(options: { license: string; }) => Promise
```

| Param | Type |
| ------------- | --------------------------------- |
| **`options`** | { license: string; } |

--------------------

### recognizeBase64String(...)

```typescript
recognizeBase64String(options: { base64: string; }) => Promise<{ results: DLRResult[]; }>
```

| Param | Type |
| ------------- | -------------------------------- |
| **`options`** | { base64: string; } |

**Returns:** Promise<{ results: DLRResult[]; }>

--------------------

### recognizeBitmap()

```typescript
recognizeBitmap() => Promise<{ results: DLRResult[]; }>
```

Android and iOS only method which directly read camera frames from capacitor-plugin-dynamsoft-camera-preview

**Returns:** Promise<{ results: DLRResult[]; }>

--------------------

### updateRuntimeSettings(...)

```typescript
updateRuntimeSettings(options: { settings: RuntimeSettings; }) => Promise
```

| Param | Type |
| ------------- | -------------------------------------------------------------------------- |
| **`options`** | { settings: RuntimeSettings; } |

--------------------

### resetRuntimeSettings()

```typescript
resetRuntimeSettings() => Promise
```

--------------------

### setEngineResourcesPath(...)

```typescript
setEngineResourcesPath(options: { path: string; }) => Promise
```

| Param | Type |
| ------------- | ------------------------------ |
| **`options`** | { path: string; } |

--------------------

### addListener('onResourcesLoadStarted', ...)

```typescript
addListener(eventName: 'onResourcesLoadStarted', listenerFunc: onResourcesLoadStartedListener) => Promise & PluginListenerHandle
```

| Param | Type |
| ------------------ | ----------------------------------------------------------------------------------------- |
| **`eventName`** | 'onResourcesLoadStarted' |
| **`listenerFunc`** | onResourcesLoadStartedListener |

**Returns:** Promise<PluginListenerHandle> & PluginListenerHandle

--------------------

### addListener('onResourcesLoaded', ...)

```typescript
addListener(eventName: 'onResourcesLoaded', listenerFunc: onResourcesLoadedListener) => Promise & PluginListenerHandle
```

| Param | Type |
| ------------------ | ------------------------------------------------------------------------------- |
| **`eventName`** | 'onResourcesLoaded' |
| **`listenerFunc`** | onResourcesLoadedListener |

**Returns:** Promise<PluginListenerHandle> & PluginListenerHandle

--------------------

### removeAllListeners()

```typescript
removeAllListeners() => Promise
```

--------------------

### Interfaces

#### DLRResult

| Prop | Type |
| ----------------- | ------------------------------------------------------------- |
| **`location`** | DLRQuadrilateral |
| **`confidence`** | number |
| **`lineResults`** | DLRLineResult[] |

#### DLRQuadrilateral

| Prop | Type |
| ------------ | ----------------------- |
| **`points`** | DLRPoint[] |

#### DLRPoint

| Prop | Type |
| ------- | ------------------- |
| **`x`** | number |
| **`y`** | number |

#### DLRLineResult

| Prop | Type |
| ------------------------- | ------------------------------------------------------------- |
| **`text`** | string |
| **`location`** | DLRQuadrilateral |
| **`confidence`** | number |
| **`isCheckDigitMatched`** | boolean |

#### RuntimeSettings

| Prop | Type |
| ----------------------- | --------------------------------------------------------------- |
| **`template`** | string |
| **`customModelConfig`** | CustomModelConfig |

#### CustomModelConfig

| Prop | Type |
| -------------------------- | --------------------- |
| **`customModelFolder`** | string |
| **`customModelFileNames`** | string[] |

#### PluginListenerHandle

| Prop | Type |
| ------------ | ----------------------------------------- |
| **`remove`** | () => Promise<void> |

### Type Aliases

#### onResourcesLoadStartedListener

(resourcePath: string): void

#### onResourcesLoadedListener

(resourcePath: string): void