How to Upgrade to Version 11.x
From version 10.x
To upgrade from version 10.x to 11.x, we recommend you to take the following steps.
1. Update the License Key
Request a 30-Day Free Trial License
Visit the Request a Trial License page to obtain a 30-day free license. This option is ideal for initial evaluation or testing of new SDK features.
Annual Online Full License
If you are using an Annual Online Full License, your license will continue to work with the current SDK version without the need for updates. Go to Customer Portal to get your license key.
Perpetual License
For users with a Perpetual License, please contact our sales team to update your license. You can reach out through our Contacting Us page for assistance.
2. Update the Assembly Files
Download the latest SDK package and update the relevant header and library files. Please note the following changes:
- Directory Structure Change: The
Distributablesdirectory has been renamed toDistin the extracted package. - vcomp140.dll Removed: This DLL is no longer provided in the package. If your application depends on it, ensure it is available in your system environment.
3. Migrate Your Templates
The template system is upgraded. The template you used for the previous version can’t be directly recognized by the new version. Please use the template upgrade tool to upgrade your template.
4. Rebuild the Project
After updating the SDK files, clean and rebuild your project to ensure all dependencies are properly linked and to avoid potential compatibility issues.
From version 9.x or earlier
Dynamsoft Barcode Reader SDK has been refactored to integrate with DynamsoftCaptureVision (DCV) architecture since version 10. To upgrade from version 9.x or earlier to 11.x, we recommend you to follow the User Guide and re-write your codes. This section highlights only the key changes and necessary actions for upgrading the SDK.
Update the License Key
Request a 30-Day Free Trial License
Visit the Request a Trial License page to obtain a 30-day free license. This option is ideal for initial evaluation or testing of new SDK features.
Annual Online Full License
If you are using an Annual Online Full License, your license will continue to work with the current SDK version without the need for updates. Go to Customer Portal to get your license key.
Perpetual License
For users with a Perpetual License, please contact our sales team to update your license. You can reach out through our Contacting Us page for assistance.
Update the Included Headers, Libs & DLLs
Since the SDK architecture is changed, you have to change your code for including the headers, libs and DLLs. You can use the following code to replace your previous code.
#include "[INSTALLATION FOLDER]/Include/DynamsoftCaptureVisionRouter.h"
using namespace std;
using namespace dynamsoft::license;
using namespace dynamsoft::cvr;
using namespace dynamsoft::dbr;
using namespace dynamsoft::utility;
#if defined(_WIN64) || defined(_WIN32)
#ifdef _WIN64
#pragma comment(lib, "[INSTALLATION FOLDER]/Dist/Lib/Windows/x64/DynamsoftCorex64.lib")
#pragma comment(lib, "[INSTALLATION FOLDER]/Dist/Lib/Windows/x64/DynamsoftLicensex64.lib")
#pragma comment(lib, "[INSTALLATION FOLDER]/Dist/Lib/Windows/x64/DynamsoftCaptureVisionRouterx64.lib")
#pragma comment(lib, "[INSTALLATION FOLDER]/Dist/Lib/Windows/x64/DynamsoftUtilityx64.lib")
#else
#pragma comment(lib, "[INSTALLATION FOLDER]/Dist/Lib/Windows/x86/DynamsoftCorex86.lib")
#pragma comment(lib, "[INSTALLATION FOLDER]/Dist/Lib/Windows/x86/DynamsoftLicensex86.lib")
#pragma comment(lib, "[INSTALLATION FOLDER]/Dist/Lib/Windows/x86/DynamsoftCaptureVisionRouterx86.lib")
#pragma comment(lib, "[INSTALLATION FOLDER]/Dist/Lib/Windows/x86/DynamsoftUtilityx86.lib")
#endif
#endif
Distribution
- Copy
[INSTALLATION FOLDER]/Dist/Templates/DBR-PresetTemplates.jsonto the same folder as the executable program. - Copy the libraries to the same folder as the executable program.
- For Windows: Copy ALL
*.dllfiles under[INSTALLATION FOLDER]/Dist/Lib/Windows/[platform]. Replace[platform]with your project’s platform setting. - For Linux: Copy ALL
*.sofiles under[INSTALLATION FOLDER]/Dist/Lib/Linux/[platform]. Replace[platform]with your project’s platform setting.
- For Windows: Copy ALL
Update the License Activation Code
Starting from 10.0, we have unified the API for setting licenses across different Dynamsoft products.
| Old APIs | New APIs |
|---|---|
CBarcodeReader.InitLicense |
CLicenseManager.InitLicense |
Update Single Image Decoding APIs
The APIs for decoding single image have been adjusted as follows:
| Old APIs | New APIs |
|---|---|
CBarcodeReader.DecodeFile |
CCaptureVisionRouter.Capture(const char* filePath, const char* templateName) |
CBarcodeReader.DecodeFileInMemory |
CCaptureVisionRouter.Capture(const unsigned char fileBytes, int fileSize, const char templateName) |
CBarcodeReader.DecodeBuffer |
CCaptureVisionRouter.Capture(const CImageData* pImageData, const char* templateName) |
struct TextResult |
class CBarcodeResultItem |
struct TextResultArray |
class CCapturedResult |
CBarcodeReader.DecodeBase64String |
Currently not available. |
CBarcodeReader.DecodeDIB |
Currently not available. |
Update Video Streaming Decoding Code
CImageSourceAdapter is added to replace the FrameDecodeingParameters and the previous video methods. You should implement CImageSourceAdapter to transfer image data from camera or video file to buffer. The following code snippet demonstrate basic usage of decoding video frames:
class MyVideoSource : public CProactiveImageSourceAdapter
{
// You should implement the `HasNextImageToFetch` method to indicate if there is a next frame
bool HasNextImageToFetch() const override
{
return true;
}
// You should implement the `FetchImage` method to get the next frame
CImageData* FetchImage() override
{
// Add code to get the video frame from camera or video file
}
};
class MyBarcodeResultReceiver: public CCapturedResultReceiver
{
public:
virtual void OnDecodedBarcodesReceived(DecodedBarcodesResult * result) {
// Add code to process the result
}
};
int main()
{
CCaptureVisionRouter *cvRouter = new CCaptureVisionRouter;
// Create your video source and bind it to the router
MyVideoSource *source = new MyVideoSource;
cvRouter->SetInput(source);
// Create a CCapturedResultReceiver instance
MyBarcodeResultReceiver *barcodesReceiver = new MyCapturedResultReceiver;
cvRouter->AddResultReceiver(barcodesReceiver);
// Start capturing
errorCode = cvRouter->StartCapturing(CPresetTemplate::PT_READ_BARCODES, true, errorMsg, 512);
delete barcodesReceiver;
delete source;
delete cvRouter;
}
Migrate Your Templates
The template system is upgraded. The template you used for the previous version can’t be directly recognized by the new version. Please use the template upgrade tool to upgrade your template.
The template-based APIs have been updated as follows:
| Old APIs | New APIs |
|---|---|
CBarcodeReader.InitRuntimeSettingsWithFile |
CCaptureVisionRouter.InitSettingsFromFile |
CBarcodeReader.InitRuntimeSettingsWithString |
CCaptureVisionRouter.InitSettings |
CBarcodeReader.OutputSettingsToFile |
CCaptureVisionRouter.OutputSettingsToFile |
CBarcodeReader.OutputSettingsToString |
CCaptureVisionRouter.OutputSettings |
CBarcodeReader.ResetRuntimeSettings |
CCaptureVisionRouter.ResetSettings |
CBarcodeReader.AppendTplFileToRuntimeSettings |
Not available. |
CBarcodeReader.AppendTplStringToRuntimeSettings |
Not available. |
Migrate Your PublicRuntimeSettings
The struct PublicRuntimeSettings has been refactored. It retains commonly used properties while removing the previously complex property settings, which are now exclusively supported through templates.
The APIs for accessing and updating PublicRuntimeSettings have been adjusted as follows:
| Old APIs | New APIs |
|---|---|
CBarcodeReader.GetRuntimeSettings |
CCaptureVisionRouter.GetSimplifiedSettings |
CBarcodeReader.UpdateRuntimeSettings |
CCaptureVisionRouter.UpdateSettings |
Migrate to SimplifiedCaptureVisionSettings
The following properties are replaced by similar properties under SimplifiedCaptureVisionSettings. They can also be set via a template file(String).
| PublicRuntimeSettings Property | SimplifiedCaptureVisionSettings Parameter | Template File Parameter |
|---|---|---|
region |
roi & roiMeasuredInPercentage |
TargetROIDef.Location.Offset |
timeout |
timeout |
CaptureVisionTemplates.Timeout |
Migrate to SimplifiedBarcodeReaderSettings
The following properties are replaced by similar properties under SimplifiedBarcodeReaderSettings. The majority of them can also be set via a template file(String).
| PublicRuntimeSettings Property | SimplifiedBarcodeReaderSettings Property | Template File Parameter |
|---|---|---|
minBarcodeTextLength |
minBarcodeTextLength |
BarcodeFormatSpecification.BarcodeTextLengthRangeArray |
minResultConfidence |
minResultConfidence |
BarcodeFormatSpecification.MinResultConfidence |
localizationModes |
localizationModes |
BarcodeReaderTaskSetting.LocationModes |
expectedBarcodesCount |
expectedBarcodesCount |
BarcodeReaderTaskSetting.ExpectedBarcodesCount |
barcodeFormatIds |
barcodeFormatIds |
BarcodeReaderTaskSetting.BarcodeFormatIds |
barcodeFormatIds_2 |
barcodeFormatIds |
BarcodeReaderTaskSetting.BarcodeFormatIds |
deblurModes |
deblurModes |
BarcodeReaderTaskSetting.DeblurModes |
deblurLevel |
deblurModes |
BarcodeReaderTaskSetting.DeblurModes |
maxAlgorithmThreadCount |
maxThreadsInOneTask |
BarcodeReaderTaskSetting.MaxThreadsInOneTask |
Remarks:
- The 2 groups of barcode formats are merged.
DeblurLevelis deprecated. You can useDeblurModesinstead.
| FurtherModes Property | SimplifiedBarcodeReaderSettings Property | Template File Parameter |
|---|---|---|
grayscaleTransformationModes |
grayscaleTransformationModes |
ImageParameter.GrayscaleTransformationModes |
imagePreprocessingModes |
grayscaleEnhancementModes |
ImageParameter.GrayscaleEnhancementModes |
Remarks: The mode
IPM_MORPHOLOGYofimagePreprocessingModesis migrated toBinarizationModes. The mode argumentsMorphOperation,MorphOperationKernelSizeX,MorphOperationKernelSizeY,MorphShapeare now available for all modes ofBinarizationModes.
Migrate to Template File
The following properties can only be set via a template file. Please call CBarcodeReader.OutputSettingsToFile first with the old version to export the settings and then use the template upgrade tool to upgrade your template.
| PublicRuntimeSettings Property | Template File Parameter |
|---|---|
scaleDownThreshold |
ImageParameter.ImageScaleSettings |
binarizationModes |
ImageParameter.BinarizationModes |
textResultOrderModes |
BarcodeReaderTaskSetting.TextResultOrderModes |
returnBarcodeZoneClarity |
BarcodeReaderTaskSetting.ReturnBarcodeZoneClarity |
scaleUpModes |
BarcodeReaderTaskSetting.BarcodeScaleModes |
barcodeZoneMinDistanceToImageBorders |
BarcodeFormatSpecification.BarcodeZoneMinDistanceToImageBorders |
| FurtherModes Property | Template File Parameter |
|---|---|
colourConversionModes |
ImageParameter.ColourConversionModes |
regionPredetectionModes |
BarcodeReaderTaskSetting.RegionPredetectionModes |
textureDetectionModes |
ImageParameter.TextureDetectionModes |
textFilterModes |
ImageParameter.TextDetectionMode & ImageParameter.IfEraseTextZone |
dpmCodeReadingModes |
BarcodeReaderTaskSetting.DPMCodeReadingModes |
deformationResistingModes |
BarcodeReaderTaskSetting.DeformationResistingModes |
barcodeComplementModes |
BarcodeReaderTaskSetting.BarcodeComplementModes |
Migrate to Other APIs
The PDF properties of PublicRuntimeSettings are moved to set via the setPDFReadingParameter method of CDirectoryFetcher and CFileFetcher with a CPDFReadingParameter parameter.
| PublicRuntimeSettings Property |
|---|
pdfReadingMode |
pdfRasterDPI |
The Intermediate Result system is redesigned and the following properties are deprecated.
| PublicRuntimeSettings Property |
|---|
intermediateResultTypes |
intermediateResultSavingMode |
Removed
The following properties are removed.
| PublicRuntimeSettings Property |
|---|
barcodeColourModes |
resultCoordinateType |
terminatePhase |
| FurtherModes Property |
|---|
colourClusteringModes |