Skip to content

Commit 34e9118

Browse files
committed
clean history
0 parents  commit 34e9118

File tree

213 files changed

+9927
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

213 files changed

+9927
-0
lines changed

.github/workflows/main.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: CI
4+
5+
# Controls when the workflow will run
6+
on:
7+
# Allows you to run this workflow manually from the Actions tab
8+
workflow_dispatch:
9+
10+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
11+
jobs:
12+
# This workflow contains a single job called "build"
13+
Build-Demo:
14+
if: ${{ github.ref == 'refs/heads/demo' }}
15+
16+
# The type of runner that the job will run on
17+
runs-on: self-hosted
18+
19+
# Steps represent a sequence of tasks that will be executed as part of the job
20+
steps:
21+
# Runs a set of commands using the runners shell
22+
- name: Get Source
23+
run: |
24+
cd /home/ubuntu
25+
[ -d barcode-reader-javascript-samples ] && rm -rf barcode-reader-javascript-samples
26+
git clone --depth 1 -b demo https://github.com/Dynamsoft/barcode-reader-javascript-samples.git
27+
28+
- name: Sync files
29+
uses: SamKirkland/[email protected]
30+
with:
31+
server: ${{ secrets.FTP_DEMO_SERVER }}
32+
username: ${{ secrets.FTP_DEMO_USERNAME }}
33+
password: ${{ secrets.FTP_DEMO_PASSWORD }}
34+
port: 21
35+
local-dir: /home/ubuntu/barcode-reader-javascript-samples/
36+
server-dir: /Demo.dynamsoft.com/Samples/DBR/JS/

.gitignore

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
.DS_Store
2+
node_modules
3+
dist
4+
build
5+
6+
# local env files
7+
.env.local
8+
.env.*.local
9+
10+
# Log files
11+
npm-debug.log*
12+
yarn-debug.log*
13+
yarn-error.log*
14+
15+
# Editor directories and files
16+
.idea
17+
.vscode
18+
*.suo
19+
*.ntvs*
20+
*.njsproj
21+
*.sln
22+
*.sw?
23+
24+
__pycache__
25+
~~*
26+
--*
27+
==*
28+
package-lock.json
29+
yarn.lock
30+
.git
31+
.npmrc
32+
/*.zip
33+
/*.py
34+
/*.exe
35+
/*.jar
36+
/*.md
37+
/*.json
38+
/*.js
39+
/*.txt
40+
/.gitattributes
41+
/.*ignore
42+
43+
!bower.json
44+
!composer.json
45+
!package.js

README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Dynamsoft Barcode Reader samples for the web
2+
3+
This repository contains multiple samples that demonstrates how to use the [Dynamsoft Barcode Reader JavaScript Edition](https://www.dynamsoft.com/barcode-reader/sdk-javascript/?utm_source=sampleReadme) for creating web-based barcode scanning applications.
4+
5+
## Request a trial license
6+
7+
A default license is included which allows you to test the sample apps for up to 24 hours. You can [request a trial license](https://www.dynamsoft.com/customer/license/trialLicense?product=dbr&package=js&utm_source=sampleReadme) via Dynamsoft customer portal to evaluate further.
8+
9+
## Documentation
10+
11+
For the developer guide and full API reference of Dynamsoft Barcode Reader JavaScript library, please check out the [documentation](https://www.dynamsoft.com/barcode-reader/programming/javascript/?ver=10.0.21&utm_source=sampleReadme).
12+
13+
## Support
14+
15+
If you have any questions, feel free to [contact Dynamsoft support](https://www.dynamsoft.com/company/contact?utm_source=sampleReadme).
16+
17+
## Sample list
18+
19+
### Hello World
20+
21+
Get the basic features of the library working with plain/native JavaScript or within a framework like [Angular](https://angular.io/), [React](https://reactjs.org/) or [Vue](https://vuejs.org/), etc.
22+
23+
* [**Hello World**](https://demo.dynamsoft.com/samples/dbr/js/hello-world/hello-world.html?utm_source=sampleReadme): Scan barcodes from video stream with minimum code in JavaScript.
24+
* [**Read an Image**](https://demo.dynamsoft.com/samples/dbr/js/hello-world/read-an-image.html?utm_source=sampleReadme): Decode barcodes from images in mobile album or desktop file system.
25+
* [**Hello World in Angular**](https://demo.dynamsoft.com/samples/dbr/js/hello-world/angular/dist/angular?utm_source=sampleReadme): Read barcodes from camera and images in an Angular application.
26+
* [**Hello World in React**](https://demo.dynamsoft.com/samples/dbr/js/hello-world/react/build/?utm_source=sampleReadme): Read barcodes from camera and images in a React application.
27+
* [**Hello World in React using Hooks**](https://demo.dynamsoft.com/samples/dbr/js/hello-world/react-hooks/build/?utm_source=sampleReadme): Read barcodes from camera and images in a React application and use the Hooks charactor of React.
28+
* [**Hello World in Vue**](https://demo.dynamsoft.com/samples/dbr/js/hello-world/vue/dist/?utm_source=sampleReadme): Read barcodes from camera and images in a Vue 3 application.
29+
* [**Hello World in Next.js**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/hello-world/next#readme): Read barcodes from camera and images in a Next.js application.
30+
* [**Hello World in Nuxt**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/hello-world/nuxt#readme): Read barcodes from camera and images in a Nuxt application.
31+
* [**Hello World in Electron**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/hello-world/electron#readme): Read barcodes from camera and images in a Electron application.
32+
* [**Hello World in PWA**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/hello-world/pwa#readme): Decode video stream in a PWA application from a webcam or a built-in camera.
33+
* [**Hello World with RequireJS**](https://demo.dynamsoft.com/samples/dbr/js/hello-world/requirejs.html?utm_source=sampleReadme): Decode video stream in an application using RequireJS from a webcam or a built-in camera.
34+
* [**Hello World with ES6**](https://demo.dynamsoft.com/samples/dbr/js/hello-world/es6.html?utm_source=sampleReadme): Decode video stream in an application using ES6 from a webcam or a built-in camera.
35+
* [**Hello World in WebView**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/hello-world/webview): Decode video stream in an application in WebView from camera.
36+
37+
### Use Cases
38+
39+
* [**Read Video and Fill a Form**](https://demo.dynamsoft.com/samples/dbr/js/use-case/fill-a-form-with-barcode-reading.html?utm_source=sampleReadme): Read barcodes to fill a form.
40+
* [**Read a Driver's License**](https://demo.dynamsoft.com/samples/dbr/js/use-case/read-a-drivers-license.html?utm_source=sampleReadme): Read the PDF417 barcode on a driver's license (AAMVA compliant) and parse it.
41+
* [**Show Result Texts on the Video**](https://demo.dynamsoft.com/samples/dbr/js/use-case/show-result-texts-on-the-video.html?utm_source=sampleReadme): Read barcodes via camera and show result texts on the video.
42+
43+
### Others
44+
45+
* [**Debug**](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/others/debug#readme): Collect the actual image frames for debugging purposes.
46+
47+
### Official Online Demo
48+
- [**Official Online Demo**](https://demo.dynamsoft.com/barcode-reader-js): Official demo for Dynamsoft Barcode Reader JavaScript Edition (written in Vue). Take our barcode scanner demo and see how it works in different modes!

balloon.min.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

favicon.ico

3.55 KB
Binary file not shown.

hello-world/README.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# The Hello World Sample Set
2+
3+
As you have already gone through the [user guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=10.2.10#getting-started---hello-world), you may have come across some basic "Hello World" code that can help you create a simple web application using our SDK quickly.
4+
5+
In this set of samples, we will revisit the "Hello World" code and show how to implement it using some popular frameworks, such as Angular, React, and Vue.
6+
7+
Let's now go through each of the samples.
8+
9+
## Hello World
10+
11+
In this example, you will learn the minimum codes required to initialize and set up the SDK.
12+
13+
Let's quickly break down the methods used in order:
14+
15+
- `Dynamsoft.License.LicenseManager.initLicense()`: This method initializes the license for using the SDK in the application.
16+
- `Dynamsoft.CVR.CaptureVisionRouter.createInstance()`: This method creates a `CaptureVisionRouter` object `cvRouter` which controls the entire process in three steps:
17+
- **Retrieve Images from the Image Source**
18+
- `cvRouter` connects to the image source through the [`Image Source Adapter`](https://www.dynamsoft.com/capture-vision/docs/core/architecture/input.html#image-source-adapter?lang=js) interface with the method `setInput()`.
19+
```js
20+
cvRouter.setInput(cameraEnhancer);
21+
```
22+
> The image source in our case is a CameraEnhancer object created with `Dynamsoft.DCE.CameraEnhancer.createInstance(view)`
23+
- **Coordinate Image-Processing Tasks**
24+
- The coordination happens behind the scenes. `cvRouter` starts the process by specifying a preset template "ReadSingleBarcode" with the method `startCapturing()`.
25+
```js
26+
cvRouter.startCapturing("ReadSingleBarcode");
27+
```
28+
- **Dispatch Results to Listening Objects**
29+
- The processing results are returned through the [`CapturedResultReceiver`](https://www.dynamsoft.com/capture-vision/docs/core/architecture/output.html#captured-result-receiver?lang=js) interface. The `CapturedResultReceiver` object `resultReceiver` is registered to `cvRouter` via the method `addResultReceiver()`.
30+
```js
31+
cvRouter.addResultReceiver(resultReceiver);
32+
```
33+
- Also note that reading from video is extremely fast and there could be many duplicate results. We can use a `MultiFrameResultCrossFilter` object with result deduplication enabled to filter out the duplicate results. The object is registered to `cvRouter` via the method `addResultFilter()`.
34+
```js
35+
cvRouter.addResultFilter(filter);
36+
```
37+
38+
> Read more on [Capture Vision Router](https://www.dynamsoft.com/capture-vision/docs/core/architecture/#capture-vision-router).
39+
40+
## Hello World - Read Barcodes from an Image
41+
42+
The second sample processes static images and returns barcode results.
43+
44+
In this sample, an event listener is set up so that the SDK decodes any images that the user uploads.
45+
46+
When working with the CaptureVisionRouter class for single image processing, the main method to use is [`capture`](https://dynamsoft.com/capture-vision/docs/web/programming/javascript/api-reference/capture-vision-router/single-file-processing.html?product=dbr&repoType=web#capture), You can find more details about this method at the link above.
47+
48+
## Hello World in Angular
49+
50+
Read more in the README under "angular".
51+
52+
## Hello World in React
53+
54+
Read more in the README under "react".
55+
56+
## Hello World in React using Hooks
57+
58+
Read more in the README under "react-hooks".
59+
60+
## Hello World in Vue
61+
62+
Read more in the README under "vue".
63+
64+
## Hello World in Next.js
65+
66+
Read more in the README under "next".
67+
68+
## Hello World in NuxtJS
69+
70+
Read more in the README under "nuxt".
71+
72+
## Hello World in Electron
73+
74+
Read more in the README under "electron".
75+
76+
## Hello World in PWA
77+
78+
Read more in the README under "pwa".
79+
80+
## Hello World with RequireJS
81+
82+
This sample shows how to use the SDK in a web page based on RequireJS.
83+
84+
## Hello World with ES6
85+
86+
This sample shows how to use the SDK in a web page based on ES6 (also known as ECMAScript 2015 or ECMAScript 6).
87+
88+
## Hello World with WebView
89+
90+
Read more in the README under "webview".
91+
92+
## Support
93+
94+
If you have any questions, feel free to [contact Dynamsoft support](https://www.dynamsoft.com/company/contact?utm_source=sampleReadme).

hello-world/angular/.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Editor configuration, see https://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.ts]
12+
quote_type = single
13+
14+
[*.md]
15+
max_line_length = off
16+
trim_trailing_whitespace = false

hello-world/angular/.gitignore

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files.
2+
3+
# Compiled output
4+
/dist
5+
/tmp
6+
/out-tsc
7+
/bazel-out
8+
9+
# Node
10+
/node_modules
11+
npm-debug.log
12+
yarn-error.log
13+
14+
# IDEs and editors
15+
.idea/
16+
.project
17+
.classpath
18+
.c9/
19+
*.launch
20+
.settings/
21+
*.sublime-workspace
22+
23+
# Visual Studio Code
24+
.vscode/*
25+
!.vscode/settings.json
26+
!.vscode/tasks.json
27+
!.vscode/launch.json
28+
!.vscode/extensions.json
29+
.history/*
30+
31+
# Miscellaneous
32+
/.angular/cache
33+
.sass-cache/
34+
/connect.lock
35+
/coverage
36+
/libpeerconnection.log
37+
testem.log
38+
/typings
39+
40+
# System files
41+
.DS_Store
42+
Thumbs.db
43+
44+
package-lock.json

hello-world/angular/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# DbrjsSampleAngular
2+
3+
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 17.3.7.
4+
5+
## Development server
6+
7+
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files.
8+
9+
## Code scaffolding
10+
11+
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
12+
13+
## Build
14+
15+
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
16+
17+
## Running unit tests
18+
19+
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
20+
21+
## Running end-to-end tests
22+
23+
Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
24+
25+
## Further help
26+
27+
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.

0 commit comments

Comments
 (0)