Thanks for downloading Dynamsoft Barcode Reader Package!
Your download will start shortly. If your download does not begin, click here to retry.
This article introduces the parameter definitions, organization structure, usage rules and related interfaces involved in Dynamsoft Barcode Reader.
Dynamsoft Barcode Reader uses a template to set parameters. A template contains three types of data: ImageParameter
, RegionDefinition
, and FormatSpecification
.
ImageParameter
is used to specify the decoding operation settings on the entire image. The value of the ImageParameter.Name
field is the unique identifier of the ImageParameter
.RegionDefinition
is used to specify a decoding region. It is also used to specify the decoding operation settings in this area. The value of the RegionDefinition.Name
field is the unique identifier of RegionDefinition
.FormatSpecification
is used to specify a barcode format. It is also used to specify the decoding operation settings of this barcode format. The value of the FormatSpecification.Name
field is the unique identifier of FormatSpecification
.ImageParameter
in a template definition. The ImageParameter.Name
field denotes the unique identifier of the template;RegionDefinition
can be referenced through RegionDefinitionNameArray
in ImageParameter
;FormatSpecification
can be referenced through FormatSpecificationNameArray
in ImageParameter
;FormatSpecification
can be referenced through FormatSpecificationNameArray
in RegionDefinition
;ImageParameterContentArray
/RegionDefinitionArray
/FormatSpecificationArray
field to define multiple ImageParameter
/RegionDefinition
/FormatSpecification
, for example:{
"ImageParameterContentArray": [
{
"Name": "ImageParameter1",
"BarcodeFormatIds": ["BF_ONED"]
},
{
"Name": "ImageParameter2",
"BarcodeFormatIds": ["BF_ALL"]
}
]
}
When the same parameter is set in both ImageParameter
and RegionDefinition
, the decoding operation in the region specified by RegionDefinition
is used; otherwise, the parameter values under the ImageParameter
will be used.
When the same parameter is set in both ImageParameter
and FormatSpecification
, the decoding operation for the barcode format specified by FormatSpecification
is used; otherwise, the parameter values under the ImageParameter
will be used.
When the same parameter is set in both RegionDefinition
and FormatSpecification
, the decoding operation for the barcode format specified by FormatSpecification
is used in the region specified by RegionDefinition
; otherwise, the parameter values under the ImageParameter
will be used.
The parameters of ImageParameter
are:
The parameters of RegionDefinition
are:
The parameters of FormatSpecification
are:
When setting parameters through a JSON template, Dynamsoft Barcode Reader will process the template according to the following rules:
ImageParameter
/RegionDefinition
/FormatSpecification
will be filled with default valuesFormatSpecification
is automatically split into multiple settings for a single barcode format, for example:Template you set
{
"ImageParameter":{
"Name": "ImageParameter1",
"BarcodeFormatIds": ["BF_ONED"],
"FormatSpecificationNameArray": [
"FormatSpecification1"
]
},
"FormatSpecification": {
"Name": "FormatSpecification1",
"BarcodeFormatIds": ["BF_CODE_39","BF_CODE_128"],
"MinResultConfidence": 20
}
}
Template used by DBR
{
"ImageParameter":{
"Name": "ImageParameter1",
"BarcodeFormatIds": ["BF_ONED"],
"FormatSpecificationNameArray": [
"FormatSpecification1_BF_CODE_39",
"FormatSpecification1_BF_CODE_128"
]
},
"FormatSpecificationArray":[
{
"Name": "FormatSpecification1_BF_CODE_39",
"BarcodeFormatIds": ["BF_CODE_39"],
"MinResultConfidence": 20
},
{
"Name": "FormatSpecification1_BF_CODE_128",
"BarcodeFormatIds": ["BF_CODE_128"],
"MinResultConfidence": 20
}
]
}
When the two templates are merged, duplicate parameter settings in the defined ImageParameter
are handled as follows:
ConflictMode
. If ConflictMode
is IGNORE
, the first value is taken. If ConflictMode
is OVERWRITE
, the last value is taken
The entire decoding process of Dynamsoft Barcode Reader consists of many subdivided functions, among which the control parameters of some function blocks are designed in accordance with the format of Modes-Mode-Argument. That is, a function is controlled by a Modes parameter. There are many ways to implement this function, each method (Mode) has multiple unique settings, and each setting is an Argument.
For example, one of the functions in the decoding process is barcode localization. Dynamsoft Barcode Reader provides the LocalizationModes
parameter to control this function. It provides LM_CONNECTED_BLOCKS
, LM_STATISTICS
, LM_LINES
, LM_SCAN_DIRECTLY
, LM_STATISTICS_MARKS
, LM_STATISTICS_POSTAL_CODE
, a total of 6 methods to implement barcode localization. For LM_SCAN_DIRECTLY, there are two Arguments, ScanStride
and ScanDirection
.
Dynamsoft Barcode Reader provides two ways to set parameters: PublicRuntimeSettings
and JSON template files.
PublicRuntimeSettings
is used to modify the Dynamsoft Barcode Reader built-in template, and only supports commonly used parameters. The following are the steps to update Dynamsoft Barcode Reader parameters through PublicRuntimeSettings
:
ResetRuntimeSettings
interfaceGetRuntimeSettings
interface to get the current PublicRuntimeSettings
of the Dynamsoft Barcode Reader objectPublicRuntimeSettings
in the previous stepUpdateRuntimeSettings
interface to apply the modified PublicRuntimeSettings
in the previous step to the Dynamsoft Barcode Reader objectSetModeArgument
interface to set the optional argument for a specified mode in Modes parameters.JSON templates supports all Dynamsoft Barcode Reader parameters. The related parameter setting interfaces are:
InitRuntimeSettingsWithFile
: After calling this interface, the template definition in the file are processed according to the merging rules stated in the “Multiple parameter template files” section. Each independent template is stored in the Dynamsoft Barcode Reader object. All templates are merged into one template, then replace the built-in template of Dynamsoft Barcode Reader;InitRuntimeSettingsWithString
: The effect after calling this interface is the same as InitRuntimeSettingsWithFile
. The only difference is the template definition of InitRuntimeSettingsWithString
is saved as a string;AppendTplFileToRuntimeSettings
: After calling this interface, the template definition in the file will be processed according to the merging rules stated in the “Multiple parameter template files” section . Each independent template is stored in the Dynamsoft Barcode Reader object. All templates, including Dynamsoft Barcode Reader’s built-in template, are merged into one template to replace the built-in template of Dynamsoft Barcode Reader;AppendTplStringToRuntimeSettings
: The effect after calling this interface is the same as AppendTplFileToRuntimeSettings
. The only difference is the template definition of AppendTplStringToRuntimeSettings
is saved as a string.version 7.6.0