Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions hello-world/angular/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Below is the configuration used for this sample.

```cmd
cd my-app
npm install dynamsoft-barcode-reader-bundle
npm install dynamsoft-barcode-reader-bundle -E
```

## Start to implement
Expand Down Expand Up @@ -348,7 +348,7 @@ export class ImageCaptureComponent {
<div class='title'>
<h2 class='title-text'>Hello World for Angular</h2>
</div>
<div class='top-btns'>
<div class='buttons-container'>
<button (click)="switchMode('video')" [ngStyle]="{'background-color': mode === 'video' ? 'rgb(255,174,55)' : 'white'}">Decode Video</button>
<button (click)="switchMode('image')" [ngStyle]="{'background-color': mode === 'image' ? 'rgb(255,174,55)' : 'white'}">Decode Image</button>
</div>
Expand Down
10 changes: 5 additions & 5 deletions hello-world/angular/src/app/app.component.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,30 @@
align-items: center;
margin-top: 20px;
}
.top-btns {
.buttons-container {
width: 30%;
margin: 20px auto;
}
.top-btns button {
.buttons-container button {
display: inline-block;
border: 1px solid black;
padding: 5px 15px;
background-color: transparent;
cursor: pointer;
}
.top-btns button:first-child {
.buttons-container button:first-child {
border-top-left-radius: 10px;
border-bottom-left-radius: 10px;
border-right: transparent;
}
.top-btns button:nth-child(2) {
.buttons-container button:nth-child(2) {
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
border-left: transparent;
}

@media screen and (max-width: 800px) {
.top-btns {
.buttons-container {
width: 70%;
}
}
Expand Down
2 changes: 1 addition & 1 deletion hello-world/angular/src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class='title'>
<h2 class='title-text'>Hello World for Angular</h2>
</div>
<div class='top-btns'>
<div class='buttons-container'>
<button (click)="switchMode('video')" [ngStyle]="{'background-color': mode === 'video' ? 'rgb(255,174,55)' : 'white'}">Decode Video</button>
<button (click)="switchMode('image')" [ngStyle]="{'background-color': mode === 'image' ? 'rgb(255,174,55)' : 'white'}">Decode Image</button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
width: 100%;
height: 10vh;
overflow: auto;
white-space: pre-wrap;
}
2 changes: 1 addition & 1 deletion hello-world/es6.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<h1>Hello World for ES6 (Decode via Camera)</h1>
<div id="camera-view-container" style="width: 100%; height: 80vh"></div>
Results:<br />
<div id="results" style="width: 100%; height: 10vh; overflow: auto"></div>
<div id="results" style="width: 100%; height: 10vh; overflow: auto; white-space: pre-wrap"></div>
<script type="module">
import {
CoreModule,
Expand Down
2 changes: 1 addition & 1 deletion hello-world/hello-world.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<h1>Hello World (Decode via Camera)</h1>
<div id="camera-view-container" style="width: 100%; height: 80vh"></div>
Results:<br />
<div id="results" style="width: 100%; height: 10vh; overflow: auto"></div>
<div id="results" style="width: 100%; height: 10vh; overflow: auto; white-space: pre-wrap"></div>
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader-bundle@10.2.1000/dist/dbr.bundle.js"></script>
<script>
/** LICENSE ALERT - README
Expand Down
6 changes: 5 additions & 1 deletion hello-world/next/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Below is the configuration used for this sample.

```cmd
cd my-app
npm install dynamsoft-barcode-reader-bundle
npm install dynamsoft-barcode-reader-bundle -E
```

## Start to implement
Expand Down Expand Up @@ -421,3 +421,7 @@ You can check out [the Next.js GitHub repository](https://github.com/vercel/next
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.

## Support

If you have any questions, feel free to [contact Dynamsoft Support](https://www.dynamsoft.com/company/contact?utm_source=sampleReadme).
1 change: 1 addition & 0 deletions hello-world/next/components/VideoCapture/VideoCapture.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
width: 100%;
height: 10vh;
overflow: auto;
white-space: pre-wrap;
}
83 changes: 5 additions & 78 deletions hello-world/nuxt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ You will be asked to configure quite a few things for the application during the

```cmd
cd my-app
npm install dynamsoft-barcode-reader-bundle
npm install dynamsoft-barcode-reader-bundle -E
```

## Start to implement
Expand Down Expand Up @@ -102,7 +102,7 @@ CoreModule.loadWasm(["DBR"]);

### Edit the `VideoCapture` component

* In `VideoCapture.client.vue`, add code for initializing and destroying some instances. The `VideoCapture` component helps decode barcodes via camera.
* In `VideoCapture.client.vue`, add code for initializing and destroying some instances. The `VideoCapture` component helps decode barcodes via camera. For our stylesheet (CSS) specification, please refer to our [source code](#Official-Sample).

```vue
<!-- /components/VideoCapture.client.vue -->
Expand Down Expand Up @@ -196,37 +196,14 @@ onBeforeUnmount(async () => {
} catch (_) { }
});
</script>

<template>
<div>
<div ref="cameraViewContainer" class="camera-view-container"></div>
<br />
Results:
<div ref="resultsContainer" class="results"></div>
</div>
</template>

<style scoped>
.camera-view-container {
width: 100%;
height: 70vh;
background: #eee;
}

.results {
width: 100%;
height: 10vh;
overflow: auto;
}
</style>
```
> Note:
>
> If you're looking to customize the UI, the UI customization feature are provided by the auxiliary SDK "Dynamsoft Camera Enhancer". For more details, refer to our [User Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/index.html#customize-the-ui)

### Edit the `ImageCapture` component

* In `ImageCapture.client.vue`, add code for initializing and destroying the `CaptureVisionRouter` instance. The `ImageCapture` helps decode barcodes in an image.
* In `ImageCapture.client.vue`, add code for initializing and destroying the `CaptureVisionRouter` instance. The `ImageCapture` helps decode barcodes in an image. For our stylesheet (CSS) specification, please refer to our [source code](#Official-Sample).

```vue
<!-- /components/ImageCapture.client.vue -->
Expand Down Expand Up @@ -296,35 +273,13 @@ onBeforeUnmount(async () => {
<div class="results" ref="resultContainer"></div>
</div>
</template>

<style scoped>
.image-capture-container {
width: 100%;
height: 100%;
font-family: Consolas, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace;
}

.image-capture-container .input-container {
width: 80%;
height: 100%;
display: flex;
justify-content: center;
border: 1px solid black;
margin: 0 auto;
}

.image-capture-container .results {
margin-top: 20px;
height: 100%;
}
</style>
```

### Add `VideoCapture` and `ImageCapture` components in `app.vue`

* On `/app.vue`, we will edit the component so that it offers buttons to switch components between `VideoCapture` and `ImageCapture`.

* Add following code to `app.vue`.
* Add following code to `app.vue`. For our stylesheet (CSS) specification, please refer to our [source code](#Official-Sample).

```vue
<!-- /app.vue -->
Expand All @@ -333,7 +288,7 @@ onBeforeUnmount(async () => {
<div class='title'>
<h2 class='title-text'>Hello World for NuxtJS</h2>
</div>
<div class='top-btns'>
<div class='buttons-container'>
<button @click="mode = 'video'"
:style="{ backgroundColor: mode === 'video' ? 'rgb(255, 174, 55)' : '#FFFFFF' }">Video Capture</button>
<button @click="mode = 'image'"
Expand All @@ -355,34 +310,6 @@ import ImageCapture from "./components/ImageCapture.client.vue";

const mode: Ref<string> = ref("video");
</script>

<style scoped>
.title {
display: flex;
justify-content: center;
align-items: center;
margin-top: 20px;
}

.top-btns {
width: 30%;
margin: 20px auto;
}

.top-btns button {
display: inline-block;
border: 1px solid black;
padding: 5px 15px;
background-color: transparent;
cursor: pointer;
}

@media screen and (max-width: 800px) {
.top-btns {
width: 70%;
}
}
</style>
```
> Note:
>
Expand Down
12 changes: 6 additions & 6 deletions hello-world/nuxt/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<h2 class='title-text'>Hello World for NuxtJS</h2>
<img class='title-logo' src="./assets/logo.svg" alt="logo" />
</div>
<div class='top-btns'>
<div class='buttons-container'>
<button @click="mode = 'video'"
:style="{ backgroundColor: mode === 'video' ? 'rgb(255, 174, 55)' : '#FFFFFF' }">Video Capture</button>
<button @click="mode = 'image'"
Expand Down Expand Up @@ -41,33 +41,33 @@ const mode: Ref<string> = ref("video");
margin-left: 10px;
}

.top-btns {
.buttons-container {
width: 30%;
margin: 20px auto;
}

.top-btns button {
.buttons-container button {
display: inline-block;
border: 1px solid black;
padding: 5px 15px;
background-color: transparent;
cursor: pointer;
}

.top-btns button:first-child {
.buttons-container button:first-child {
border-top-left-radius: 10px;
border-bottom-left-radius: 10px;
border-right: transparent;
}

.top-btns button:nth-child(2) {
.buttons-container button:nth-child(2) {
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
border-left: transparent;
}

@media screen and (max-width: 800px) {
.top-btns {
.buttons-container {
width: 70%;
}
}
Expand Down
1 change: 1 addition & 0 deletions hello-world/nuxt/components/VideoCapture.client.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,5 +109,6 @@ onBeforeUnmount(async () => {
width: 100%;
height: 10vh;
overflow: auto;
white-space: pre-wrap;
}
</style>
5 changes: 1 addition & 4 deletions hello-world/nuxt/dynamsoft.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ CoreModule.engineResourcePaths = {
* To use the library, you need to first specify a license key using the API "initLicense()" as shown below.
*/

LicenseManager.initLicense(
"DLS2eyJoYW5kc2hha2VDb2RlIjoiMTAyODk0NDUwLVRYbFhaV0pRY205cSIsIm1haW5TZXJ2ZXJVUkwiOiJodHRwczovL21sdHMuZHluYW1zb2Z0LmNvbSIsIm9yZ2FuaXphdGlvbklEIjoiMTAyODk0NDUwIiwic3RhbmRieVNlcnZlclVSTCI6Imh0dHBzOi8vc2x0cy5keW5hbXNvZnQuY29tIiwiY2hlY2tDb2RlIjoxMDUxNjY0NjUyfQ==",
true
);
LicenseManager.initLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9", true);

/**
* You can visit https://www.dynamsoft.com/customer/license/trialLicense?utm_source=github&product=dbr&package=js to get your own trial license good for 30 days.
Expand Down
2 changes: 1 addition & 1 deletion hello-world/react-hooks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ npx create-react-app my-app --template typescript

```cmd
cd my-app
npm install dynamsoft-barcode-reader-bundle
npm install dynamsoft-barcode-reader-bundle -E
```

## Start to implement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
width: 100%;
height: 10vh;
overflow: auto;
white-space: pre-wrap;
}
2 changes: 1 addition & 1 deletion hello-world/react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ npx create-react-app my-app --template typescript

```cmd
cd my-app
npm install dynamsoft-barcode-reader-bundle
npm install dynamsoft-barcode-reader-bundle -E
```

## Start to implement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
width: 100%;
height: 10vh;
overflow: auto;
white-space: pre-wrap;
}
2 changes: 1 addition & 1 deletion hello-world/requirejs.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ <h1>Hello World for RequireJS (Decode via Camera)</h1>
<div id="camera-view-container" style="width: 100%; height: 80vh"></div>
Results:
<br />
<div id="results" style="width: 100%; height: 10vh; overflow: auto"></div>
<div id="results" style="width: 100%; height: 10vh; overflow: auto; white-space: pre-wrap"></div>
<script>
requirejs(
["https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader-bundle@10.2.1000/dist/dbr.bundle.js"],
Expand Down
Loading