Table of contents

Setting Methods - CaptureVisionRouter Class

Method Description
initSettings Loads and initializes a template from a string.
initSettingsFromFile Loads and initializes a template from a file.
outputSettings Exports a specific CaptureVisionTemplate to a string.
outputSettingsToFile Exports a specific CaptureVisionTemplate to a file.
getSimplifiedSettings Retrieves a SimplifiedCaptureVisionSettings object for a specific CaptureVisionTemplate.
updateSettings Updates a CaptureVisionTemplate with SimplifiedCaptureVisionSettings object.
resetSettings Resets all templates to factory settings.
getParameterTemplateCount Gets the total number of available parameter templates.
getParameterTemplateName Gets the name of a specific parameter template by its index.
switchCapturingTemplate Switches the capturing template during the image processing workflow.

initSettings

Loads and initializes a template from a string.

public CaptureVisionError initSettings(String content) throws CaptureVisionException

Parameters

content The string containing the template.

Return Value

Returns a CaptureVisionError object that contains error information.

Exceptions

CaptureVisionException

See Also

CaptureVisionError

initSettingsFromFile

Loads and initializes a template from a file.

public CaptureVisionError initSettingsFromFile(String filePath) throws CaptureVisionException

Parameters

filePath The path to the file containing the template.

Return Value

Returns a CaptureVisionError object that contains error information.

Exceptions

CaptureVisionException

See Also

CaptureVisionError

outputSettings

Exports a specific template to a string.

public String outputSettings(String templateName) throws CaptureVisionException
public String outputSettings(String templateName, boolean includeDefaultValues) throws CaptureVisionException

Parameters

templateName The name of the CaptureVisionTemplate to be exported.

includeDefaultValues Specifies whether to include default values in the exported template.

Remarks

  • It is supported to export all loaded templates by specifying the templateName as ‘*’.
  • There are two types of CaptureVisionTemplate: the preset ones which come with the SDK and the custom ones that get initialized when the user calls initSettings / initSettingsFromFile.
  • When using a custom template, the parameter templateName should be the name of the CaptureVisionTemplate object in the JSON template file.
  • Please be aware that the preset CaptureVisionTemplates will be overwritten should the user call initSettings / initSettingsFromFile and pass his own settings.
  • If parameter templateName is not specified, the preset one named ‘Default’ will be used. However, if the preset ones have been overwritten as described above, the first CaptureVisionTemplate from the user’s own settings will be used instead.

Return Value

Returns a string containing the exported template.

Exceptions

CaptureVisionException

outputSettingsToFile

Exports a specific template to a file.

public void outputSettingsToFile(String templateName, String filePath) throws CaptureVisionException
public void outputSettingsToFile(String templateName, String filePath, boolean includeDefaultValues) throws CaptureVisionException

Parameters

templateName The name of the template to be exported.

filePath The path to the output file.

includeDefaultValues Specifies whether to include default values in the exported template.

Remarks

  • It is supported to export all loaded templates by specifying the templateName as ‘*’.
  • There are two types of CaptureVisionTemplate: the preset ones which come with the SDK and the custom ones that get initialized when the user calls initSettings / initSettingsFromFile.
  • When using a custom template, the parameter templateName should be the name of the CaptureVisionTemplate object in the JSON template file.
  • Please be aware that the preset CaptureVisionTemplates will be overwritten should the user call initSettings / initSettingsFromFile and pass his own settings.
  • If parameter templateName is not specified, the preset one named ‘Default’ will be used. However, if the preset ones have been overwritten as described above, the first CaptureVisionTemplate from the user’s own settings will be used instead.

Exceptions

CaptureVisionException

getSimplifiedSettings

Retrieves a simplified version of the capture settings for a specific template.

public SimplifiedCaptureVisionSettings getSimplifiedSettings(String templateName) throws CaptureVisionException

Parameters

templateName The name of the template.

Remarks

  • There are two types of CaptureVisionTemplate: the preset ones which come with the SDK and the custom ones that get initialized when the user calls initSettings / initSettingsFromFile.
  • When using a custom template, the parameter templateName should be the name of the CaptureVisionTemplate object in the JSON template file.
  • Please be aware that the preset CaptureVisionTemplates will be overwritten should the user call initSettings / initSettingsFromFile and pass his own settings.
  • If parameter templateName is not specified, the preset one named ‘Default’ will be used. However, if the preset ones have been overwritten as described above, the first CaptureVisionTemplate from the user’s own settings will be used instead.

Return Value

Returns a SimplifiedCaptureVisionSettings object containing all settings.

Exceptions

CaptureVisionException

See Also

SimplifiedCaptureVisionSettings

updateSettings

Updates a template with simplified capture settings.

public void updateSettings(String templateName, SimplifiedCaptureVisionSettings settings) throws CaptureVisionException

Parameters

templateName The name of the template to be updated.

settings A SimplifiedCaptureVisionSettings object.

Remarks

  • There are two types of CaptureVisionTemplate: the preset ones which come with the SDK and the custom ones that get initialized when the user calls initSettings / initSettingsFromFile.
  • When using a custom template, the parameter templateName should be the name of the CaptureVisionTemplate object in the JSON template file.
  • Please be aware that the preset CaptureVisionTemplates will be overwritten should the user call initSettings / initSettingsFromFile and pass his own settings.
  • If parameter templateName is not specified, the preset one named ‘Default’ will be used. However, if the preset ones have been overwritten as described above, the first CaptureVisionTemplate from the user’s own settings will be used instead.

Exceptions

CaptureVisionException

See Also

SimplifiedCaptureVisionSettings

resetSettings

Resets all templates to factory settings.

public void resetSettings() throws CaptureVisionException

Exceptions

CaptureVisionException

getParameterTemplateCount

Gets the total number of available parameter templates.

public int getParameterTemplateCount()

Return value

Returns an integer representing the count of parameter templates.

getParameterTemplateName

Gets the name of a specific parameter template by its index.

public String getParameterTemplateName(int index)

Parameters

index The index of the parameter template to get.

Return value

Returns a string containing the name of the parameter template.

switchCapturingTemplate

Switches the capturing template during the image processing workflow.

public void switchCapturingTemplate(String templateName) throws CaptureVisionException

Parameters

templateName The name of the new capturing template to apply.

Exceptions

CaptureVisionException

Remarks

  • Introduced in Dynamsoft Barcode Reader SDK version 11.2.1000 and Dynamsoft Capture Vision version 3.2.1000.

This page is compatible for:

Is this page helpful?

YesYes NoNo

In this article: