Skip to content

Commit 612a1f2

Browse files
docs: Updated index.md with rewording some of the comments
1 parent a6a5859 commit 612a1f2

File tree

1 file changed

+7
-5
lines changed
  • programming/javascript/user-guide

1 file changed

+7
-5
lines changed

programming/javascript/user-guide/index.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ When creating a `CaptureVisionRouter` object within a function which may be call
376376
```javascript
377377
Dynamsoft.License.LicenseManager.initLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9");
378378

379-
let pCvRouter = null; // promise of cvRouter
379+
let pCvRouter = null; // The helper variable which is a promise of cvRouter
380380
let cvRouter = null;
381381

382382
document.getElementById('btn-scan').addEventListener('click', async () => {
@@ -520,10 +520,10 @@ const EnumCRIT = Dynamsoft.Core.EnumCapturedResultItemType;
520520
resultReceiver.onCapturedResultReceived = (result) => {
521521
let barcodes = result.items.filter(item => item.type === EnumCRIT.CRIT_BARCODE);
522522
if (barcodes.length > 0) {
523+
// Use a filter to get the image on which barcodes are found.
523524
let image = result.items.filter(
524525
item => item.type === EnumCRIT.CRIT_ORIGINAL_IMAGE
525526
)[0].imageData;
526-
// The image that we found the barcode(s) on.
527527
}
528528
};
529529
```
@@ -544,8 +544,10 @@ await cvRouter.startCapturing("ReadSingleBarcode");
544544
##### Specify a scan region
545545
546546
We can specify a scan region to allow the SDK to process only part of the image, improving processing speed. The code snippet below demonstrates how to do this using the `cameraEnhancer` image source.
547+
547548
```javascript
548549
cameraEnhancer = await Dynamsoft.DCE.CameraEnhancer.createInstance(cameraView);
550+
// In this example, we set the scan region to cover the central 25% of the image.
549551
cameraEnhancer.setScanRegion({
550552
x: 25,
551553
y: 25,
@@ -600,15 +602,15 @@ await cvRouter.startCapturing("ReadSingleBarcode");
600602
601603
#### Edit the preset templates directly
602604
603-
The preset templates have a lot more settings that can be customized to best suit your use case. If you [download the SDK from Dynamsoft website](https://www.dynamsoft.com/barcode-reader/downloads/1000003-confirmation/), you can find the templates under
605+
The preset templates have many more settings that can be customized to suit your use case best. If you [download the SDK from Dynamsoft website](https://www.dynamsoft.com/barcode-reader/downloads/1000003-confirmation/), you can find the templates under
604606
605607
* "/dynamsoft-barcode-reader-js-10.2.10/dynamsoft/resources/barcode-reader/templates/"
606608
607609
Upon completing the template editing, you can invoke the `initSettings` method and provide it with the template path as an argument.
608610
609611
```javascript
610-
await cvRouter.initSettings("PATH-TO-THE-FILE"); //e.g. "https://your-website/ReadSingleBarcode.json")
611-
await cvRouter.startCapturing("ReadSingleBarcode"); // Make sure the name matches one of the CaptureVisionTemplates in the json file.
612+
await cvRouter.initSettings("PATH-TO-THE-FILE"); // E.g. "https://your-website/ReadSingleBarcode.json")
613+
await cvRouter.startCapturing("ReadSingleBarcode"); // Make sure the name matches one of the CaptureVisionTemplates in the template JSON file.
612614
```
613615
614616
#### Filter the results (Important)

0 commit comments

Comments
 (0)