Awesome
capacitor-plugin-dynamsoft-document-normalizer
A document scanning plugin for Capacitor using Dynamsoft Document Normalizer.
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
npm install capacitor-plugin-dynamsoft-document-normalizer
npx cap sync
API
<docgen-index>initialize()
initLicense(...)
initRuntimeSettingsFromString(...)
detect(...)
detectBitmap(...)
normalize(...)
detectAndNormalize(...)
setEngineResourcePaths(...)
- Interfaces
initialize()
initialize() => Promise<void>
initLicense(...)
initLicense(options: { license: string; }) => Promise<void>
Param | Type |
---|---|
options | <code>{ license: string; }</code> |
initRuntimeSettingsFromString(...)
initRuntimeSettingsFromString(options: { template: string; }) => Promise<void>
Param | Type |
---|---|
options | <code>{ template: string; }</code> |
detect(...)
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 | <code>{ path?: string; source?: any; template?: string; }</code> |
Returns: <code>Promise<{ results: DetectedQuadResultItem[]; }></code>
detectBitmap(...)
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 | <code>{ className?: string; methodName?: string; template?: string; }</code> |
Returns: <code>Promise<{ results: DetectedQuadResultItem[]; }></code>
normalize(...)
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 | <code>{ path?: string; source?: any; quad: <a href="#quadrilateral">Quadrilateral</a>; template?: string; saveToFile?: boolean; includeBase64?: boolean; }</code> |
Returns: <code>Promise<{ result: <a href="#normalizedimageresult">NormalizedImageResult</a>; }></code>
detectAndNormalize(...)
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 | <code>{ path?: string; source?: any; template?: string; saveToFile?: boolean; includeBase64?: boolean; }</code> |
Returns: <code>Promise<{ result: <a href="#normalizedimageresult">NormalizedImageResult</a>; }></code>
setEngineResourcePaths(...)
setEngineResourcePaths(options: { paths: any; }) => Promise<void>
Web Only
Param | Type |
---|---|
options | <code>{ paths: any; }</code> |
Interfaces
DetectedQuadResultItem
Prop | Type |
---|---|
location | <code><a href="#quadrilateral">Quadrilateral</a></code> |
confidenceAsDocumentBoundary | <code>number</code> |
Quadrilateral
Prop | Type |
---|---|
points | <code>[Point, <a href="#point">Point</a>, <a href="#point">Point</a>, Point]</code> |
Point
Prop | Type |
---|---|
x | <code>number</code> |
y | <code>number</code> |
NormalizedImageResult
Prop | Type |
---|---|
base64 | <code>string</code> |
path | <code>string</code> |