Home

Awesome

capacitor-plugin-dynamsoft-document-normalizer

A document scanning plugin for Capacitor using Dynamsoft Document Normalizer.

Online demo

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

ProductAndroidiOSWeb
Dynamsoft Document Normalizer2.x2.x2.x

Supported Platforms

Install

npm install capacitor-plugin-dynamsoft-document-normalizer
npx cap sync

API

<docgen-index> </docgen-index> <docgen-api> <!--Update the source file JSDoc comments and rerun docgen to update the docs below-->

initialize()

initialize() => Promise<void>

initLicense(...)

initLicense(options: { license: string; }) => Promise<void>
ParamType
options<code>{ license: string; }</code>

initRuntimeSettingsFromString(...)

initRuntimeSettingsFromString(options: { template: string; }) => Promise<void>
ParamType
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

ParamType
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.

ParamType
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

ParamType
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

ParamType
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

ParamType
options<code>{ paths: any; }</code>

Interfaces

DetectedQuadResultItem

PropType
location<code><a href="#quadrilateral">Quadrilateral</a></code>
confidenceAsDocumentBoundary<code>number</code>

Quadrilateral

PropType
points<code>[Point, <a href="#point">Point</a>, <a href="#point">Point</a>, Point]</code>

Point

PropType
x<code>number</code>
y<code>number</code>

NormalizedImageResult

PropType
base64<code>string</code>
path<code>string</code>
</docgen-api>