MENU
Table of contents

Thanks for downloading Dynamsoft Barcode Reader Package!

Your download will start shortly. If your download does not begin, click here to retry.

.Net API Reference - BarcodeReader Parameter and Runtime Settings Advanced Methods

Method Description
InitRuntimeSettingsWithFile Initializes runtime settings with the settings in a given JSON file.
InitRuntimeSettingsWithString Initializes runtime settings with the settings in a given JSON string.
AppendTplFileToRuntimeSettings Appends a new template file to the current runtime settings.
AppendTplStringToRuntimeSettings Appends a new template string to the current runtime settings.
GetAllParameterTemplateNames Gets the parameter templates name array.
OutputSettingsToFile Outputs runtime settings to a settings file (JSON file).
OutputSettingsToString Outputs runtime settings to a string.

InitRuntimeSettingsWithFile

Initialize runtime settings with the settings in a given JSON file.

EnumErrorCode Dynamsoft.DBR.BarcodeReader.InitRuntimeSettingsWithFile(string jsonFileName, EnumConflictMode conflictMode, out string errorMessage)

Parameters

[in] jsonFileName <string> : The path of the settings file.
[in] conflictMode <EnumConflictMode> : The parameter setting mode, which decides to inherit parameters from previous template setting or overwrite previous settings and replace by new template.
[in,out] errorMessage <string> : Output parameter storing detailed error message.

Return value

Returns error code.

Code Snippet

BarcodeReader reader = new BarcodeReader();
reader.ProductKeys = "t0260NwAAAHV***************";
string errorMessage;
EnumErrorCode error = reader.InitRuntimeSettingsWithFile(@"C:\Program Files (x86)\Dynamsoft\{Version number}\Templates\RuntimeSettings.json", EnumConflictMode.CM_OVERWRITE, out errorMessage);
reader.Dispose();

 

InitRuntimeSettingsWithString

Initialize runtime settings with the settings in given JSON string.

EnumErrorCode Dynamsoft.DBR.BarcodeReader.InitRuntimeSettingsWithString(string jsonContent, EnumConflictMode conflictMode, out string errorMessage)

Parameters

[in] jsonContent <string> : A JSON string that represents the content of the settings.
[in] conflictMode <EnumConflictMode> : The parameter setting mode, which decides to inherit parameters from previous template setting or overwrite previous settings and replace by new template.
[in,out] errorMessage <string> : Output parameter storing detailed error message.

Return value

Returns error code.

Code Snippet

BarcodeReader reader = new BarcodeReader();
reader.ProductKeys = "t0260NwAAAHV***************";
string errorMessage;
EnumErrorCode error = reader.InitRuntimeSettingsWithString("{\"Version\":\"3.0\", \"ImageParameter\":{\"Name\":\"IP1\", \"BarcodeFormatIds\":[\"BF_QR_CODE\"], \"ExpectedBarcodesCount\":10}}", EnumConflictMode.CM_OVERWRITE, out errorMessage);
reader.Dispose();

 

AppendTplFileToRuntimeSettings

Append a new template file to the current runtime settings.

EnumErrorCode Dynamsoft.DBR.BarcodeReader.AppendTplFileToRuntimeSettings(string jsonFileName, EnumConflictMode conflictMode, out string errorMessage)

Parameters

[in] jsonFileName <string> : The path of the settings file.
[in] conflictMode <EnumConflictMode> : The parameter setting mode, which decides to inherit parameters from previous template setting or overwrite previous settings and replace by new template.
[in,out] errorMessage <string> : Output parameter storing detailed error message.

Return value

Returns error code.

Code Snippet

BarcodeReader reader = new BarcodeReader();
reader.ProductKeys = "t0260NwAAAHV***************";
string errorMessage;
EnumErrorCode error = reader.AppendTplFileToRuntimeSettings(@"C:\Program Files (x86)\Dynamsoft\Barcode Reader 6.4\Templates\RuntimeSettings.json", EnumConflictMode.CM_OVERWRITE, out errorMessage);
reader.Dispose();

 

AppendTplStringToRuntimeSettings

Append a new template string to the current runtime settings.

EnumErrorCode Dynamsoft.DBR.BarcodeReader.AppendTplStringToRuntimeSettings(string  jsonContent, EnumConflictMode  conflictMode, out string errorMessage) 

Parameters

[in] jsonContent <string> : A JSON string that represents the content of the settings.
[in] conflictMode <EnumConflictMode> : The parameter setting mode, which decides to inherit parameters from previous template setting or overwrite previous settings and replace by new template.
[in,out] errorMessage <string> : Output parameter storing detailed error message.

Return value

Returns error code.

Code Snippet

BarcodeReader reader = new BarcodeReader();
reader.ProductKeys = "t0260NwAAAHV***************";
string errorMessage;
EnumErrorCode error = reader.AppendTplStringToRuntimeSettings("{\"Version\":\"3.0\", \"ImageParameter\":{\"Name\":\"IP1\", \"BarcodeFormatIds\":[\"BF_QR_CODE\"], \"ExpectedBarcodesCount\":10}}", EnumConflictMode.CM_IGNORE, out errorMessage);
reader.Dispose();

 

GetAllParameterTemplateNames

Gets the parameter templates name array.

string[] Dynamsoft.DBR.BarcodeReader.GetAllParameterTemplateNames()

Return value

The template name array.

Code Snippet

BarcodeReader reader = new BarcodeReader();
reader.ProductKeys = "t0260NwAAAHV***************";
string errorMessage;
reader.InitRuntimeSettingsWithFile(@"C:\Program Files (x86)\Dynamsoft\{Version number}\Templates\RuntimeSettings.json", EnumConflictMode.CM_OVERWRITE, out errorMessage);
reader.AppendTplStringToRuntimeSettings("{\"Version\":\"3.0\", \"ImageParameter\":{\"Name\":\"IP1\", \"BarcodeFormatIds\":[\"BF_QR_CODE\"], \"ExpectedBarcodesCount\":10}}", EnumConflictMode.CM_IGNORE, out errorMessage);
string[] templateNameArray = reader.GetAllParameterTemplateNames();
reader.Dispose();

 

OutputSettingsToFile

Output runtime settings to a settings file (JSON file).

void Dynamsoft.DBR.BarcodeReader.OutputSettingsToFile(string outputFilePath, string settingsName)

Parameters

[in] outputFilePath <string> : The output file path which stores current settings.
[in] settingsName <string> : A unique name for declaring current runtime settings.

Exceptions

BarcodeReaderException The exception thrown by Dynamsoft Barcode Reader.

Code Snippet

BarcodeReader reader = new BarcodeReader();
reader.ProductKeys = "t0260NwAAAHV***************";
string errorMessage;
reader.InitRuntimeSettingsWithFile(@"C:\Program Files (x86)\Dynamsoft\{Version number}\Templates\RuntimeSettings.json", EnumConflictMode.CM_OVERWRITE, out errorMessage);
reader.AppendTplStringToRuntimeSettings("{\"Version\":\"3.0\", \"ImageParameter\":{\"Name\":\"IP1\", \"BarcodeFormatIds\":[\"BF_QR_CODE\"], \"ExpectedBarcodesCount\":10}}", EnumConflictMode.CM_IGNORE, out errorMessage);
reader.OutputSettingsToFile(@"C:\Program Files (x86)\Dynamsoft\{Version number}\Templates\CurrentRuntimeSettings.json", "currentRuntimeSettings");
reader.Dispose();

 

OutputSettingsToString

Output runtime settings to a string.

string Dynamsoft.DBR.BarcodeReader.OutputSettingsToString(string settingsName)

Parameters

[in] settingsName <string> : A unique name for declaring current runtime settings.

Return value

The output string which stores the contents of current settings.

Exceptions

BarcodeReaderExceptionThe exception thrown by Dynamsoft Barcode Reader.

Code Snippet

BarcodeReader reader = new BarcodeReader();
reader.ProductKeys = "t0260NwAAAHV***************";
string errorMessage;
reader.InitRuntimeSettingsWithFile(@"C:\Program Files (x86)\Dynamsoft\{Version number}\Templates\RuntimeSettings.json", EnumConflictMode.CM_OVERWRITE, out errorMessage);
reader.AppendTplStringToRuntimeSettings("{\"Version\":\"3.0\", \"ImageParameter\":{\"Name\":\"IP1\", \"BarcodeFormatIds\":[\"BF_QR_CODE\"], \"ExpectedBarcodesCount\":10}}", EnumConflictMode.CM_IGNORE, out errorMessage);
string currentSettings = reader.OutputSettingsToString("currentRuntimeSettings");
reader.Dispose();

This page is compatible for:

Version 7.5

Is this page helpful?

YesYes NoNo

In this article:

latest version

  • Latest Version
  • version 7.6
  • version 7.5
Change +
© 2003–2020 Dynamsoft. All rights reserved.
Privacy Statement / Site Map / Home / Purchase / Support