Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tony-xlh/capacitor-plugin-dynamsoft-document-normalizer
A document scanning plugin for Capacitor using Dynamsoft Document Normalizer
https://github.com/tony-xlh/capacitor-plugin-dynamsoft-document-normalizer
Last synced: 3 months ago
JSON representation
A document scanning plugin for Capacitor using Dynamsoft Document Normalizer
- Host: GitHub
- URL: https://github.com/tony-xlh/capacitor-plugin-dynamsoft-document-normalizer
- Owner: tony-xlh
- License: mit
- Created: 2022-11-11T03:20:41.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-07T07:52:10.000Z (4 months ago)
- Last Synced: 2024-11-08T07:45:20.422Z (4 months ago)
- Language: Java
- Size: 2.75 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-capacitor - Document Normalizer - Scan documents using Dynamsoft Document Normalizer. (Other plugins)
README
# capacitor-plugin-dynamsoft-document-normalizer
A document scanning plugin for Capacitor using [Dynamsoft Document Normalizer](https://www.dynamsoft.com/document-normalizer/docs/).
[Online demo](https://chic-syrniki-fac13f.netlify.app/)
## Versions
For Capacitor v6, use versions >= 3.0.
For Capacitor v5, use versions 1.x and 2.x.
For Capacitor v4, use v0.x.
## SDK Versions Used for Different Platforms
| Product | Android | iOS | Web |
| ----------- | ----------- | ----------- | ------- |
| Dynamsoft Document Normalizer | 2.x | 2.x | 2.x |## Supported Platforms
* Web
* Android
* iOS## Install
```bash
npm install capacitor-plugin-dynamsoft-document-normalizer
npx cap sync
```## API
* [`initialize()`](#initialize)
* [`initLicense(...)`](#initlicense)
* [`initRuntimeSettingsFromString(...)`](#initruntimesettingsfromstring)
* [`detect(...)`](#detect)
* [`detectBitmap(...)`](#detectbitmap)
* [`normalize(...)`](#normalize)
* [`detectAndNormalize(...)`](#detectandnormalize)
* [`setEngineResourcePaths(...)`](#setengineresourcepaths)
* [Interfaces](#interfaces)### initialize()
```typescript
initialize() => Promise
```--------------------
### initLicense(...)
```typescript
initLicense(options: { license: string; }) => Promise
```| Param | Type |
| ------------- | --------------------------------- |
| **`options`** |{ license: string; }
|--------------------
### initRuntimeSettingsFromString(...)
```typescript
initRuntimeSettingsFromString(options: { template: string; }) => Promise
```| Param | Type |
| ------------- | ---------------------------------- |
| **`options`** |{ template: string; }
|--------------------
### detect(...)
```typescript
detect(options: { path?: string; source?: string | HTMLImageElement | HTMLCanvasElement; template?: string; }) => Promise<{ results: DetectedQuadResultItem[]; }>
```source: Android and iOS only support base64 string.
path: for Android and iOS.
template: pass a template name to specify the template| Param | Type |
| ------------- | ---------------------------------------------------------------- |
| **`options`** |{ path?: string; source?: any; template?: string; }
|**Returns:**
Promise<{ results: DetectedQuadResultItem[]; }>
--------------------
### detectBitmap(...)
```typescript
detectBitmap(options: { className?: string; methodName?: string; template?: string; }) => Promise<{ results: DetectedQuadResultItem[]; }>
```Android and iOS only method which directly reads camera frames from capacitor-plugin-camera. Pass a template name to specify the template.
| Param | Type |
| ------------- | ---------------------------------------------------------------------------- |
| **`options`** |{ className?: string; methodName?: string; template?: string; }
|**Returns:**
Promise<{ results: DetectedQuadResultItem[]; }>
--------------------
### normalize(...)
```typescript
normalize(options: { path?: string; source?: string | HTMLImageElement | HTMLCanvasElement; quad: Quadrilateral; template?: string; saveToFile?: boolean; includeBase64?: boolean; }) => Promise<{ result: NormalizedImageResult; }>
```source: Android and iOS only support base64 string.
path: for Android and iOS.
template: pass a template name to specify the template| Param | Type |
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`options`** |{ path?: string; source?: any; quad: Quadrilateral; template?: string; saveToFile?: boolean; includeBase64?: boolean; }
|**Returns:**
Promise<{ result: NormalizedImageResult; }>
--------------------
### detectAndNormalize(...)
```typescript
detectAndNormalize(options: { path?: string; source?: string | HTMLImageElement | HTMLCanvasElement; template?: string; saveToFile?: boolean; includeBase64?: boolean; }) => Promise<{ result: NormalizedImageResult; }>
```source: Android and iOS only support base64 string.
path: for Android and iOS.
template: pass a template name to specify the template| Param | Type |
| ------------- | --------------------------------------------------------------------------------------------------------------- |
| **`options`** |{ path?: string; source?: any; template?: string; saveToFile?: boolean; includeBase64?: boolean; }
|**Returns:**
Promise<{ result: NormalizedImageResult; }>
--------------------
### setEngineResourcePaths(...)
```typescript
setEngineResourcePaths(options: { paths: any; }) => Promise
```Web Only
| Param | Type |
| ------------- | ---------------------------- |
| **`options`** |{ paths: any; }
|--------------------
### Interfaces
#### DetectedQuadResultItem
| Prop | Type |
| ---------------------------------- | ------------------------------------------------------- |
| **`location`** |Quadrilateral
|
| **`confidenceAsDocumentBoundary`** |number
|#### Quadrilateral
| Prop | Type |
| ------------ | ----------------------------------------------------------------------------------- |
| **`points`** |[Point, Point, Point, Point]
|
| **`area`** |number
|#### Point
| Prop | Type |
| ------- | ------------------- |
| **`x`** |number
|
| **`y`** |number
|#### NormalizedImageResult
| Prop | Type |
| ------------ | ------------------- |
| **`base64`** |string
|
| **`path`** |string
|