Skip to content

Commit 20fb72b

Browse files
committed
add BarcodeScanner samples
1 parent 5e29d10 commit 20fb72b

File tree

291 files changed

+1060
-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.

291 files changed

+1060
-0
lines changed

hello-world/angular/src/assets/.gitkeep renamed to barcode-scanner-api-samples/scan-multiple-barcodes/README.md

File renamed without changes.
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>Dynamsoft Barcode Scanner Sample - Hello World (Decode via Camera)</title>
8+
<script src="https://npm.scannerproxy.com:802/cdn/@dynamsoft/[email protected]/dist/dbr.bundle.js"></script>
9+
<style>
10+
* {
11+
margin: 0;
12+
padding: 0;
13+
box-sizing: border-box;
14+
}
15+
html, body {
16+
width: 100%;
17+
height: 100%;
18+
}
19+
.dbs-title {
20+
height: 80px;
21+
text-align: center;
22+
font-size: 20px;
23+
padding: 20px 0;
24+
}
25+
.dbs-container {
26+
width: 100%;
27+
height: calc(100% - 80px);
28+
}
29+
</style>
30+
</head>
31+
32+
<body>
33+
<h1 class="dbs-title">Hello World (Decode via Camera)</h1>
34+
<div class="dbs-container"></div>
35+
<script>
36+
let config = {
37+
license: "YOUR-LICENSE-KEY",
38+
container: ".dbs-container",
39+
scanMode: Dynamsoft.EnumScanMode.SM_MULTI_UNIQUE,
40+
showResultView: true,
41+
showUploadImageButton: true,
42+
scannerViewConfig: {
43+
showCloseButton: true
44+
},
45+
}
46+
const dbs = new Dynamsoft.BarcodeScanner(config);
47+
dbs.launch().then((result)=>{
48+
console.log(result);
49+
})
50+
</script>
51+
</body>
52+
53+
</html>

barcode-scanner-api-samples/scan-single-barcode/README.md

Whitespace-only changes.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
ij_typescript_use_double_quotes = false
14+
15+
[*.md]
16+
max_line_length = off
17+
trim_trailing_whitespace = false
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Angular
2+
3+
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 19.2.8.
4+
5+
## Development server
6+
7+
To start a local development server, run:
8+
9+
```bash
10+
ng serve
11+
```
12+
13+
Once the server is running, open your browser and navigate to `http://localhost:4200/`. The application will automatically reload whenever you modify any of the source files.
14+
15+
## Code scaffolding
16+
17+
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
18+
19+
```bash
20+
ng generate component component-name
21+
```
22+
23+
For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
24+
25+
```bash
26+
ng generate --help
27+
```
28+
29+
## Building
30+
31+
To build the project run:
32+
33+
```bash
34+
ng build
35+
```
36+
37+
This will compile your project and store the build artifacts in the `dist/` directory. By default, the production build optimizes your application for performance and speed.
38+
39+
## Running unit tests
40+
41+
To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
42+
43+
```bash
44+
ng test
45+
```
46+
47+
## Running end-to-end tests
48+
49+
For end-to-end (e2e) testing, run:
50+
51+
```bash
52+
ng e2e
53+
```
54+
55+
Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
56+
57+
## Additional Resources
58+
59+
For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"angular": {
7+
"projectType": "application",
8+
"schematics": {},
9+
"root": "",
10+
"sourceRoot": "src",
11+
"prefix": "app",
12+
"architect": {
13+
"build": {
14+
"builder": "@angular-devkit/build-angular:application",
15+
"options": {
16+
"outputPath": "dist/angular",
17+
"index": "src/index.html",
18+
"browser": "src/main.ts",
19+
"polyfills": [
20+
"zone.js"
21+
],
22+
"tsConfig": "tsconfig.app.json",
23+
"assets": [
24+
{
25+
"glob": "**/*",
26+
"input": "public"
27+
}
28+
],
29+
"styles": [
30+
"src/styles.css"
31+
],
32+
"scripts": []
33+
},
34+
"configurations": {
35+
"production": {
36+
"budgets": [
37+
{
38+
"type": "initial",
39+
"maximumWarning": "500kB",
40+
"maximumError": "1MB"
41+
},
42+
{
43+
"type": "anyComponentStyle",
44+
"maximumWarning": "4kB",
45+
"maximumError": "8kB"
46+
}
47+
],
48+
"outputHashing": "all"
49+
},
50+
"development": {
51+
"optimization": false,
52+
"extractLicenses": false,
53+
"sourceMap": true
54+
}
55+
},
56+
"defaultConfiguration": "production"
57+
},
58+
"serve": {
59+
"builder": "@angular-devkit/build-angular:dev-server",
60+
"configurations": {
61+
"production": {
62+
"buildTarget": "angular:build:production"
63+
},
64+
"development": {
65+
"buildTarget": "angular:build:development"
66+
}
67+
},
68+
"defaultConfiguration": "development"
69+
},
70+
"extract-i18n": {
71+
"builder": "@angular-devkit/build-angular:extract-i18n"
72+
},
73+
"test": {
74+
"builder": "@angular-devkit/build-angular:karma",
75+
"options": {
76+
"polyfills": [
77+
"zone.js",
78+
"zone.js/testing"
79+
],
80+
"tsConfig": "tsconfig.spec.json",
81+
"assets": [
82+
{
83+
"glob": "**/*",
84+
"input": "public"
85+
}
86+
],
87+
"styles": [
88+
"src/styles.css"
89+
],
90+
"scripts": []
91+
}
92+
}
93+
}
94+
}
95+
},
96+
"cli": {
97+
"analytics": false
98+
}
99+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"name": "angular",
3+
"version": "0.0.0",
4+
"scripts": {
5+
"ng": "ng",
6+
"start": "ng serve",
7+
"build": "ng build",
8+
"watch": "ng build --watch --configuration development",
9+
"test": "ng test"
10+
},
11+
"private": true,
12+
"dependencies": {
13+
"@angular/common": "^19.2.0",
14+
"@angular/compiler": "^19.2.0",
15+
"@angular/core": "^19.2.0",
16+
"@angular/forms": "^19.2.0",
17+
"@angular/platform-browser": "^19.2.0",
18+
"@angular/platform-browser-dynamic": "^19.2.0",
19+
"@angular/router": "^19.2.0",
20+
"@dynamsoft/dynamsoft-barcode-reader-bundle": "^10.5.1000-dev-20250418130750",
21+
"rxjs": "~7.8.0",
22+
"tslib": "^2.3.0",
23+
"zone.js": "~0.15.0"
24+
},
25+
"devDependencies": {
26+
"@angular-devkit/build-angular": "^19.2.8",
27+
"@angular/cli": "^19.2.8",
28+
"@angular/compiler-cli": "^19.2.0",
29+
"@types/jasmine": "~5.1.0",
30+
"jasmine-core": "~5.6.0",
31+
"karma": "~6.4.0",
32+
"karma-chrome-launcher": "~3.2.0",
33+
"karma-coverage": "~2.2.0",
34+
"karma-jasmine": "~5.1.0",
35+
"karma-jasmine-html-reporter": "~2.1.0",
36+
"typescript": "~5.7.2"
37+
}
38+
}

hello-world/angular/src/favicon.ico renamed to barcode-scanner-api-samples/scan-single-barcode/angular/public/favicon.ico

File renamed without changes.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
.dbs-hello-world-page {
2+
width: 100%;
3+
height: 100%;
4+
text-align: center;
5+
}
6+
7+
.dbs-title {
8+
height: 90px;
9+
display: flex;
10+
justify-content: center;
11+
align-items: center;
12+
padding: 20px 0;
13+
}
14+
15+
.dbs-title .dbs-title-logo {
16+
width: 60px;
17+
height: 60px;
18+
animation: retate 5s infinite linear;
19+
}
20+
21+
.dbs-container {
22+
width: 100%;
23+
height: calc(100% - 90px);
24+
}
25+
26+
@keyframes retate {
27+
from {
28+
transform: rotate(0deg);
29+
}
30+
31+
to {
32+
transform: rotate(360deg);
33+
}
34+
}

0 commit comments

Comments
 (0)