Skip to content

Commit a2cfd2d

Browse files
authored
Merge pull request #9 from yqz5625/patch-1
Update supported-barcode-formats.md
2 parents 6737f7c + 3a91641 commit a2cfd2d

File tree

1 file changed

+93
-1
lines changed

1 file changed

+93
-1
lines changed

general/supported-barcode-formats.md

Lines changed: 93 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,96 @@ needAutoGenerateSidebar: false
1010

1111
[<< Back to FAQ index](index.md)
1212

13-
The full list of supported barcode formats can be found [here](https://www.dynamsoft.com/barcode-reader/docs/core/introduction/?ver=latest#supported-barcode-formats).
13+
14+
Most common barcode formats are enabled by default. The full list of supported barcode formats can be found [here](https://www.dynamsoft.com/barcode-reader/docs/core/introduction/?ver=latest#supported-barcode-formats).
15+
16+
However, please note that the following formats require **manual configuration** before they can be decoded:
17+
- **Code 32**
18+
- **Matrix 2 of 5**
19+
- **Telepen**
20+
21+
### Step-by-Step Guide
22+
23+
#### Step 1. Configure Barcode Formats
24+
Update your code to explicitly enable **only the licensed formats**. Here are examples for enabling **Multiple Formats**(Use bitwise OR (|) to combine formats):
25+
26+
<div class="sample-code-prefix template2"></div>
27+
>- Javascript
28+
>- Objective-C
29+
>- Swift
30+
>- Android
31+
>- Python
32+
>- C++
33+
>- C#
34+
>
35+
>
36+
```javascript
37+
let settings = await router.getSimplifiedSettings("ReadSingleBarcode");
38+
// Enable QR Code and OneD
39+
settings.barcodeSettings.barcodeFormatIds =
40+
Dynamsoft.DBR.EnumBarcodeFormat.BF_MATRIX_25 | Dynamsoft.DBR.EnumBarcodeFormat.BF_CODE_32 | Dynamsoft.DBR.EnumBarcodeFormat.TELEPEN;
41+
await router.updateSettings("ReadSingleBarcode", settings);
42+
await router.startCapturing("ReadSingleBarcode");
43+
```
44+
>
45+
```objc
46+
DSBarcodeScannerConfig *config = [[DSBarcodeScannerConfig alloc] init];
47+
config.barcodeFormats = DSBarcodeFormatQRCode | DSBarcodeFormatOned; ;
48+
```
49+
>
50+
```swift
51+
let config = BarcodeScannerConfig()
52+
config.barcodeFormats = [.oneD, .qrCode]
53+
```
54+
>
55+
```java
56+
try {
57+
// Obtain current runtime settings. `cvr` is an instance of `CaptureVisionRouter`.
58+
// Here we use `EnumPresetTemplate.PT_READ_BARCODES` as an example. You can change it to your own template name or the name of other preset template.
59+
SimplifiedCaptureVisionSettings captureVisionSettings = cvr.getSimplifiedSettings(EnumPresetTemplate.PT_READ_BARCODES);
60+
captureVisionSettings.barcodeSettings.barcodeFormatIds = EnumBarcodeFormat.BF_MATRIX_25 | EnumBarcodeFormat.BF_CODE_32 | EnumBarcodeFormat.TELEPEN;
61+
// Update the settings. Remember to specify the same template name you used when getting the settings.
62+
cvr.updateSettings(EnumPresetTemplate.PT_READ_BARCODES, captureVisionSettings);
63+
} catch (CaptureVisionRouterException e) {
64+
e.printStackTrace();
65+
}
66+
```
67+
>
68+
```python
69+
cvr_instance = CaptureVisionRouter()
70+
# Obtain current runtime settings of `CCaptureVisionRouter` instance.
71+
err_code, err_str, settings = cvr_instance.get_simplified_settings(EnumPresetTemplate.PT_READ_BARCODES.value)
72+
# Specify the barcode formats by enumeration values.
73+
# Use "|" to enable multiple barcode formats at one time.
74+
settings.barcode_settings.barcode_format_ids = EnumBarcodeFormat.BF_MATRIX_25.value | EnumBarcodeFormat.BF_CODE_32.value | EnumBarcodeFormat.TELEPEN.value
75+
# Update the settings.
76+
err_code, err_str = cvr_instance.update_settings(EnumPresetTemplate.PT_READ_BARCODES.value, settings)
77+
```
78+
>
79+
```c++
80+
char szErrorMsg[256] = {0};
81+
// Obtain current runtime settings of `CCaptureVisionRouter` instance.
82+
CCaptureVisionRouter* cvr = new CCaptureVisionRouter;
83+
SimplifiedCaptureVisionSettings settings;
84+
cvr->GetSimplifiedSettings(CPresetTemplate::PT_READ_BARCODES, &settings);
85+
// Specify the barcode formats by enumeration values.
86+
// Use "|" to enable multiple barcode formats at one time.
87+
settings.barcodeSettings.barcodeFormatIds = BF_MATRIX_25 | BF_CODE_32 | TELEPEN;
88+
// Update the settings.
89+
cvr->UpdateSettings(CPresetTemplate::PT_READ_BARCODES, &settings, szErrorMsg, 256);
90+
```
91+
>
92+
```csharp
93+
using (CaptureVisionRouter cvr = new CaptureVisionRouter())
94+
{
95+
SimplifiedCaptureVisionSettings settings;
96+
string errorMsg;
97+
// Obtain current runtime settings of `CCaptureVisionRouter` instance.
98+
cvr.GetSimplifiedSettings(PresetTemplate.PT_READ_BARCODES, out settings);
99+
// Specify the barcode formats by enumeration values.
100+
// Use "|" to enable multiple barcode formats at one time.
101+
settings.barcodeSettings.barcodeFormatIds = (ulong)(EnumBarcodeFormat.BF_MATRIX_25 | EnumBarcodeFormat.BF_CODE_32 | EnumBarcodeFormat.TELEPEN;
102+
// Update the settings.
103+
cvr.UpdateSettings(PresetTemplate.PT_READ_BARCODES, settings, out errorMsg);
104+
}
105+
```

0 commit comments

Comments
 (0)