A document scanning plugin for Capacitor using Dynamsoft Document Normalizer.
For Capacitor v6, use versions >= 3.0.
For Capacitor v5, use versions 1.x and 2.x.
For Capacitor v4, use v0.x.
Product | Android | iOS | Web |
---|---|---|---|
Dynamsoft Document Normalizer | 2.x | 2.x | 2.x |
- Web
- Android
- iOS
npm install capacitor-plugin-dynamsoft-document-normalizer
npx cap sync
initialize()
initLicense(...)
initRuntimeSettingsFromString(...)
detect(...)
detectBitmap(...)
normalize(...)
detectAndNormalize(...)
setEngineResourcePaths(...)
- Interfaces
initialize() => Promise<void>
initLicense(options: { license: string; }) => Promise<void>
Param | Type |
---|---|
options |
{ license: string; } |
initRuntimeSettingsFromString(options: { template: string; }) => Promise<void>
Param | Type |
---|---|
options |
{ template: string; } |
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(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(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(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(options: { paths: any; }) => Promise<void>
Web Only
Param | Type |
---|---|
options |
{ paths: any; } |
Prop | Type |
---|---|
location |
Quadrilateral |
confidenceAsDocumentBoundary |
number |
Prop | Type |
---|---|
points |
[Point, Point, Point, Point] |
area |
number |
Prop | Type |
---|---|
x |
number |
y |
number |
Prop | Type |
---|---|
base64 |
string |
path |
string |