https://github.com/tony-xlh/capacitor-plugin-dynamsoft-barcode-reader
capacitor-plugin-dynamsoft-barcode-reader
https://github.com/tony-xlh/capacitor-plugin-dynamsoft-barcode-reader
barcode capacitor ionic qrcode typescript
Last synced: 23 days ago
JSON representation
capacitor-plugin-dynamsoft-barcode-reader
- Host: GitHub
- URL: https://github.com/tony-xlh/capacitor-plugin-dynamsoft-barcode-reader
- Owner: tony-xlh
- Created: 2021-11-12T05:46:31.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-02-19T07:15:39.000Z (over 1 year ago)
- Last Synced: 2025-04-09T18:48:26.000Z (over 1 year ago)
- Topics: barcode, capacitor, ionic, qrcode, typescript
- Language: Java
- Homepage:
- Size: 1.11 MB
- Stars: 10
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
Awesome Lists containing this project
- awesome-capacitor - Barcode Reader - Scan barcodes and QR codes using Dynamsoft Barcode Reader. (Other plugins)
README
# capacitor-plugin-dynamsoft-barcode-reader

A capacitor plugin for [Dynamsoft Barcode Reader](https://www.dynamsoft.com/barcode-reader/overview/).
> [!NOTE]
> This repo is not actively maintained and the performance and camera control differences between the mobile native and the JavaScript platforms are now small. You can directly use the JavaScript SDK: https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/2f0a723e88e3271170672e61c214a3d1d7a31328/frameworks/capacitor
## Install
```bash
npm install capacitor-plugin-dynamsoft-barcode-reader
npx cap sync
```
## Supported Platforms
* Android
* iOS
* Web
## Capacitor Versions
For Capacitor 7, use 3.x.
For Capacitor 6, use 2.x.
For Capacitor <= 5, use 1.x.
## SDK Versions Used for Different Platforms
| Product | Android | iOS | Web |
| ----------- | ----------- | ----------- | ------- |
| Dynamsoft Barcode Reader | 10.4.20 | 10.4.20 | 10.4.20 |
## Supported Barcode Symbologies
* Code 11
* Code 39
* Code 93
* Code 128
* Codabar
* EAN-2
* EAN-5
* EAN-8
* EAN-13
* UPC-A
* UPC-E
* UPC-2
* UPC-5
* Interleaved 2 of 5 (ITF)
* Industrial 2 of 5 (Code 2 of 5 Industry, Standard 2 of 5, Code 2 of 5)
* ITF-14
* QRCode
* DataMatrix
* PDF417
* GS1 DataBar
* Maxicode
* Micro PDF417
* Micro QR
* PatchCode
* GS1 Composite
* Postal Code
* Dot Code
* Pharmacode
## Demos
* [Ionic React](https://github.com/xulihang/Ionic-React-QR-Code-Scanner)
* [Quasar + Vue 2](https://github.com/tony-xlh/Quasar-QR-Code-Scanner)
* [Ionic + Vue 3](https://github.com/tony-xlh/Ionic-Vue-QR-Code-Scanner)
* [Vanilla JS](https://github.com/xulihang/capacitor-qr-code-scanner)
## API
* [`initLicense(...)`](#initlicense)
* [`initialize()`](#initialize)
* [`initRuntimeSettingsFromString(...)`](#initruntimesettingsfromstring)
* [`decode(...)`](#decode)
* [`decodeBitmap(...)`](#decodebitmap)
* [`setEngineResourcePaths(...)`](#setengineresourcepaths)
* [Interfaces](#interfaces)
### initLicense(...)
```typescript
initLicense(options: { license: string; }) => Promise<{ success?: boolean; message?: string; }>
```
| Param | Type |
| ------------- | --------------------------------- |
| **`options`** | { license: string; } |
**Returns:** Promise<{ success?: boolean; message?: string; }>
--------------------
### initialize()
```typescript
initialize() => Promise<{ success?: boolean; message?: string; }>
```
**Returns:** Promise<{ success?: boolean; message?: string; }>
--------------------
### initRuntimeSettingsFromString(...)
```typescript
initRuntimeSettingsFromString(options: { template: string; }) => Promise
```
| Param | Type |
| ------------- | ---------------------------------- |
| **`options`** | { template: string; } |
--------------------
### decode(...)
```typescript
decode(options: { source: string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement; template?: string; }) => Promise<{ results: TextResult[]; }>
```
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`** | { source: any; template?: string; } |
**Returns:** Promise<{ results: TextResult[]; }>
--------------------
### decodeBitmap(...)
```typescript
decodeBitmap(options: { className?: string; methodName?: string; template?: string; }) => Promise<{ results: TextResult[]; }>
```
Android and iOS only method which directly read camera frames from capacitor-plugin-camera
| Param | Type |
| ------------- | ---------------------------------------------------------------------------- |
| **`options`** | { className?: string; methodName?: string; template?: string; } |
**Returns:** Promise<{ results: TextResult[]; }>
--------------------
### setEngineResourcePaths(...)
```typescript
setEngineResourcePaths(options: { paths: any; }) => Promise
```
Web only method to set the engine resource path
| Param | Type |
| ------------- | ---------------------------- |
| **`options`** | { paths: any; } |
--------------------
### Interfaces
#### TextResult
| Prop | Type |
| ------------------------ | ------------------- |
| **`barcodeText`** | string |
| **`barcodeFormat`** | string |
| **`barcodeBytesBase64`** | string |
| **`x1`** | number |
| **`y1`** | number |
| **`x2`** | number |
| **`y2`** | number |
| **`x3`** | number |
| **`y3`** | number |
| **`x4`** | number |
| **`y4`** | number |