Web Demos

BARCODE READER SDK DEMO

Explore the flexibe barcode reading settings to optimize for your specific usage scenario.

WEB TWAIN SDK DEMO

Try the most popular web scanner features: scan images, import local images and PDF files, edit, save to local, upload to database, and etc.

BARCODE READER JAVASCRIPT DEMO

Transform any camera-equipped devices into real-time, browser-based barcode and QR code scanners.

MRZ SCANNER WEB DEMO

Detects the machine-readable zone of a passport, scans the text, and parses into human-readable data.

APP STORE DEMOS

BARCODE READER SDK FOR IOS

BARCODE READER SDK FOR ANDROID

VIEW MORE DEMOS >
Dev Center
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.

License Functions

Function Description
DBR_InitLicense Initializes license key and activate the SDK.
DBR_GetDeviceUUID Gets the device uuid used for license activating.
DBR_GetIdleInstancesCount Gets available instances count when charging by concurrent instances count.
DBR_IsInstanceValid Gets whether the instance is valid when charging by concurrent instances count.
DBR_SetDeviceFriendlyName Sets a human-readable name that identifies the device.
DBR_SetLicenseCachePath Sets a directory path for saving the license cache.
DBR_SetMaxConcurrentInstanceCount Sets the max concurrent instance count used for current device and process.
DBR_InitLicenseFromServer Deprecated
DBR_InitLicenseFromLicenseContent Deprecated
DBR_OutputLicenseToString Deprecated
DBR_OutputLicenseToStringPtr Deprecated
DBR_FreeLicenseString Deprecated
DBR_InitDLSConnectionParameters Deprecated
DBR_InitLicenseFromDLS Deprecated
DBR_InitLTSConnectionParameters Deprecated
DBR_InitLicenseFromLTS Deprecated

DBR_InitLicense

Initializes license key and activate the SDK.

DBR_API int DBR_InitLicense (const char* pLicense, char errorMsgBuffer[], const int errorMsgBufferLen)

Parameters

[in] pLicense The license string.

[in, out] errorMsgBuffer The buffer is allocated by caller and the recommended length is 512. The error message will be copied to the buffer.

[in] errorMsgBufferLen The length of allocated buffer.

Return Value

Returns error code (returns 0 if the function operates successfully).

You can call DBR_GetErrorString to get detailed error message.

Code Snippet

char errorBuf[512];
DBR_InitLicense("YOUR-LICENSE-KEY", errorBuf, 512);
void* barcodeReader = DBR_CreateInstance();
// add further process

DBR_GetDeviceUUID

Gets the device uuid used for license activating.

DBR_API int DBR_GetDeviceUUID(int uuidGenerationMethod, char ** uuid)

Parameters

[in] uuidGenerationMethod The method used to generate the UUID.

  • 1: Generates UUID with random values.
  • 2: Generates UUID based on hardware info.

[out] uuid The result UUID.

Return Value

Returns error code (returns 0 if the function operates successfully).

You can call DBR_GetErrorString to get detailed error message.

Remarks

The method DBR_FreeString needs to be called to release memory allocated for the result UUID.

DBR_IsInstanceValid

Gets whether the instance is valid when charging by concurrent instances count.

DBR_API int DBR_IsInstanceValid (void* barcodeReader)

Parameters

[in] barcodeReader Handle of a Dynamsoft Barcode Reader instance.

Return Value

Returns an int value indicating whether the instance is valid for running on concurrent instance mode.

  • 0: The instance is not valid for running on concurrent instance mode.
  • 1: The instance is valid for running on concurrent instance mode.

Remarks

This method is meaningful only when using a license charged by concurrent instances count.

DBR_GetIdleInstancesCount

Gets available instances count when charging by concurrent instances count.

DBR_API int DBR_GetIdleInstancesCount()

Return Value

Returns available instances count.

  • 0: There is no space for new instance
  • -1: The available count needs to be updated from server by calling DBR_InitLicense.
  • N ( N > 0 ): N more instances can be created.

Code Snippet

//...
int count = DBR_GetIdleInstancesCount();
if(count > 0)
{
  //create instance and process further
}
if(count < 0)
{
  //call DBR_InitLicense
  //create instance and process further
}
if(count = 0)
{
  //waiting for available instances 
}

DBR_SetDeviceFriendlyName

Sets a human-readable name that identifies the device.

DBR_API int DBR_SetDeviceFriendlyName(const char* name)

Parameters

[in] name The device alias.

Return Value

Returns error code (returns 0 if the function operates successfully).

You can call DBR_GetErrorString to get detailed error message.

Code Snippet

char errorBuf[512];
DBR_SetDeviceFriendlyName("My-PC");
DBR_InitLicense("YOUR-LICENSE-KEY", errorBuf, 512);
void* barcodeReader = DBR_CreateInstance();
// add further process

DBR_SetLicenseCachePath

Sets a directory path for saving the license cache.

DBR_API int DBR_SetLicenseCachePath(const char* directoryPath)

Parameters

[in] directoryPath The directory path where to save the license cache.

Return Value

Returns error code (returns 0 if the function operates successfully).

You can call DBR_GetErrorString to get detailed error message.

Code Snippet

char errorBuf[512];
DBR_SetLicenseCachePath("DIRECTORY-PATH-FOR-LICENSE-CACHE");
DBR_InitLicense("YOUR-LICENSE-KEY", errorBuf, 512);
void* barcodeReader = DBR_CreateInstance();
// add further process

DBR_SetMaxConcurrentInstanceCount

Sets the max concurrent instance count used for current device and process.

DBR_API void DBR_SetMaxConcurrentInstanceCount(int countForThisDevice, int countForThisProcess)

Parameters

[in] countForThisDevice The maximum number of concurrent instances that the current device can run.

[in] countForThisProcess The maximum number of concurrent instances that the current process can run.

Code Snippet

char errorBuf[512];
int countForThisDevice = 10;
int countForThisProcess = 10;
DBR_SetMaxConcurrentInstanceCount(countForThisDevice, countForThisProcess);
DBR_InitLicense("YOUR-LICENSE-KEY", errorBuf, 512);
void* barcodeReader = DBR_GetInstance();
// Add your code here to call decoding method, process barcode results and so on
// ...
// Recycle the barcodeReader instance to make it idle for other concurrent tasks
DBR_RecycleInstance(barcodeReader);

DBR_InitLicenseFromServer

Deprecated. It still works in this version but could be removed in the near future.

DBR_API int DBR_InitLicenseFromServer (void* barcodeReader, const char* pLicenseServer, const char* pLicenseKey)

DBR_InitLicenseFromLicenseContent

Deprecated. It still works in this version but could be removed in the near future.

DBR_API int DBR_InitLicenseFromLicenseContent (void* barcodeReader, const char* pLicenseKey, const char* pLicenseContent)	

DBR_OutputLicenseToString

Deprecated. It still works in this version but could be removed in the near future.

DBR_API int DBR_OutputLicenseToString (void* barcodeReader, char content[], int contentLen)

DBR_OutputLicenseToStringPtr

Deprecated. It still works in this version but could be removed in the near future.

DBR_API int DBR_OutputLicenseToStringPtr (void* barcodeReader, char** content)

DBR_FreeLicenseString

Deprecated. It still works in this version but could be removed in the near future.

DBR_API void DBR_FreeLicenseString (char** content)

DBR_InitDLSConnectionParameters

Deprecated. It still works in this version but could be removed in the near future.

DBR_API int DBR_InitDLSConnectionParameters (DM_DLSConnectionParameters *pDLSConnectionParameters)

DBR_InitLicenseFromDLS

Deprecated. It still works in this version but could be removed in the near future.

DBR_API int DBR_InitLicenseFromDLS(DM_DLSConnectionParameters *pDLSConnectionParameters, char errorMsgBuffer[], const int errorMsgBufferLen)

DBR_InitLTSConnectionParameters

Deprecated. It still works in this version but could be removed in the near future.

DBR_InitLicenseFromLTS

Deprecated. It still works in this version but could be removed in the near future.

This page is compatible for:

Version 7.5.0

Is this page helpful?

YesYes NoNo

In this article:

latest version

  • Latest version
  • Version 9.x
    • Version 9.6.0
    • Version 9.4.0
    • Version 9.2.0
    • Version 9.0.0
  • Version 8.x
    • Version 8.8.0
    • Version 8.6.0
    • Version 8.4.0
    • Version 8.2.0
    • Version 8.1.2
    • Version 8.1.0
    • Version 8.0.0
  • Version 7.x
    • Version 7.6.0
    • Version 7.5.0
Change +
© 2003–2023 Dynamsoft. All rights reserved.
Privacy Statement / Site Map / Home / Purchase / Support