Resource Base
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.

Parameter and Runtime Settings Advanced Methods

Method Description
initRuntimeSettingsWithFile Initialize runtime settings with the settings in a given JSON file.
initRuntimeSettingsWithString Initialize runtime settings with the settings in a given JSON string.
appendTplFileToRuntimeSettings Append a new template file to the current runtime settings.
appendTplStringToRuntimeSettings Append a new template string to the current runtime settings.
getAllParameterTemplateNames Gets the parameter templates name array.
outputSettingsToFile Output runtime settings to a settings file (JSON file).
outputSettingsToString Output runtime settings to a string.

initRuntimeSettingsWithFile

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

void initRuntimeSettingsWithFile(String filePath, int enumConflictMode) throws BarcodeReaderException

Parameters

filePath: The path of the settings file.
enumConflictMode: The parameter setting mode, which decides whether to inherit parameters from previous template setting or to overwrite previous settings and replace with the new template.

Exceptions

BarcodeReaderException

Code Snippet

BarcodeReader reader = new BarcodeReader();
reader.initRuntimeSettingsWithFile("your template file path", EnumConflictMode.CM_OVERWRITE);
reader.destroy();

initRuntimeSettingsWithString

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

void initRuntimeSettingsWithString(String content, int enumConflictMode)throws BarcodeReaderException

Parameters

content: A JSON string that represents the content of the settings.
enumConflictMode: The parameter setting mode, which decides whether to inherit parameters from previous template setting or to overwrite previous settings and replace with the new template.

Exceptions

BarcodeReaderException

Code Snippet

BarcodeReader reader = new BarcodeReader();
reader.initRuntimeSettingsWithString("{\"Version\":\"3.0\", \"ImageParameter\":{\"Name\":\"IP1\", \"BarcodeFormatIds\":[\"BF_QR_CODE\"], \"ExpectedBarcodesCount\":10}}", EnumConflictMode.CM_OVERWRITE);
reader.destroy();

appendTplFileToRuntimeSettings

Append a new template file to the current runtime settings.

void appendTplFileToRuntimeSettings(String filePath, int enumConflictMode) throws BarcodeReaderException

Parameters

filePath: The path of the settings file.
enumConflictMode: The parameter setting mode, which decides whether to inherit parameters from previous template setting or to overwrite previous settings with the new template.

Exceptions

BarcodeReaderException

Code Snippet

BarcodeReader reader = new BarcodeReader();
reader.appendTplFileToRuntimeSettings("your template file path", EnumConflictMode.CM_IGNORE);
reader.destroy();

appendTplStringToRuntimeSettings

Append a new template string to the current runtime settings.

void appendTplStringToRuntimeSettings(String content, int enumConflictMode) throws BarcodeReaderException

Parameters

content: A JSON string that represents the content of the settings.
enumConflictMode: The parameter setting mode, which decides whether to inherit parameters from previous template setting or to overwrite previous settings with the new template.

Exceptions

BarcodeReaderException

Code Snippet

BarcodeReader reader = new BarcodeReader();
reader.initRuntimeSettingsWithString("{\"Version\":\"3.0\", \"ImageParameter\":{\"Name\":\"IP1\", \"BarcodeFormatIds\":[\"BF_QR_CODE\"], \"ExpectedBarcodesCount\":10}}", EnumConflictMode.CM_OVERWRITE);
reader.appendTplStringToRuntimeSettings("{\"Version\":\"3.0\", \"ImageParameter\":{\"Name\":\"IP1\", \"BarcodeFormatIds\":[\"BF_OneD\"], \"ExpectedBarcodesCount\":20}}", EnumConflictMode.CM_IGNORE);
reader.destroy();

getAllParameterTemplateNames

Gets the parameter templates name array.

String [] getAllParameterTemplateNames()

Return Value

The template name array.

Exceptions

BarcodeReaderException

Code Snippet

BarcodeReader reader = new BarcodeReader();
String[] templateNames = reader.getAllParameterTemplateNames();
reader.destroy();

outputSettingsToFile

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

void outputSettingsToFile(String filePath, String settingsName) throws BarcodeReaderException

Parameters

filePath: The output file path which stores current settings.
settingsName: A unique name for declaring current runtime settings.

Exceptions

BarcodeReaderException

Code Snippet

BarcodeReader reader = new BarcodeReader();
reader.outputSettingsToFile("your saving file path", "currentRuntimeSettings");
reader.destroy();

outputSettingsToString

Output runtime settings to a string.

String outputSettingsToString(String settingsName) throws BarcodeReaderException

Parameters

settingsName A unique name for declaring current runtime settings.

Return Value

The output string which stores the contents of current settings.

Code Snippet

BarcodeReader reader = new BarcodeReader();
String settingStr = reader.outputSettingsToString("currentRuntimeSettings");
reader.destroy();

This page is compatible for:

Version 7.5.0

Is this page helpful?

YesYes NoNo

In this article:

latest version

  • Latest version
  • Version 8.6.0
  • Version 8.4.0
  • Version 8.2.5
  • Version 8.2.3
  • Version 8.2.1
  • Version 8.2.0
  • Version 8.1.3
  • Version 8.1.2
  • Version 8.1.0
  • Version 8.0.0
  • Version 7.6.0
  • Version 7.5.0
Change +
© 2003–2021 Dynamsoft. All rights reserved.
Privacy Statement / Site Map / Home / Purchase / Support