Skip to content

Commit 7cf5d99

Browse files
authored
Merge pull request #26 from ZoroWang/master
Modify samples
2 parents d8a74d1 + 35bd671 commit 7cf5d99

15 files changed

+196
-69
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
4949
### License
5050

51-
Apply for a trial license: https://www.dynamsoft.com/CustomerPortal/Portal/Triallicense.aspx
51+
Apply for a trial license: https://www.dynamsoft.com/customer/license/trialLicense
5252

5353
### Supported Symbologies
5454
*We support all major barcodes symbologies across a variety of industries such as government, finance, retail, warehouse inventory, and healthcare.*

demo/BarcodeReaderDemo.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,19 @@ def decode_files(path):
187187
# Apply for a trial license: https://www.dynamsoft.com/CustomerPortal/Portal/Triallicense.aspx
188188
reader.init_license(license_key)
189189

190-
# reader.init_license_from_server(license_server, license_key)
191-
# license_content = reader.output_license_to_string()
192-
# reader.init_license_from_license_content(license_key, license_content)
190+
## The code snippet below shows how to use the full license in DBR 8.x:
191+
# connection_paras = BarcodeReader.init_lts_connection_parameters()
192+
## If DBR service is already built on your server, you can fill in the address of your server, or leave this property's default value.
193+
# connection_paras.main_server_url = "Input your own server url"
194+
# connection_paras.handshake_code = "Input your own handshake"
195+
# connection_paras.deployment_type = EnumDMDeploymentType.DM_DT_DESKTOP
196+
# connection_paras.uuid_generation_method = EnumDMUUIDGenerationMethod.DM_UUIDGM_RANDOM
197+
# try:
198+
# error = BarcodeReader.init_licesne_from_lts(connection_paras)
199+
# if error[0] != EnumErrorCode.DBR_OK:
200+
# print(error[1])
201+
# except BarcodeReaderError as bre:
202+
# print(bre)
193203

194204
print("*************************************************")
195205
print("Welcome to Dynamsoft Barcode Reader Demo")

samples/test_AppendTemplateFile.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
# you can change the following variables' value to your own value.
77
license_key = "Input your own license"
8-
#license_server = "Input the name/IP of the license server"
98

109
json_file = r"Please input your own template path"
1110
append_json_file = r"Please input your own template path"
@@ -16,12 +15,22 @@
1615

1716
reader = BarcodeReader()
1817

19-
# Apply for a trial license: https://www.dynamsoft.com/CustomerPortal/Portal/Triallicense.aspx
18+
# Apply for a trial license: https://www.dynamsoft.com/customer/license/trialLicense
2019
reader.init_license(license_key)
2120

22-
#reader.init_license_from_server(license_server, license_key)
23-
#license_content = reader.output_license_to_string()
24-
#reader.init_license_from_license_content(license_key, license_content)
21+
## The code snippet below shows how to use the full license in DBR 8.x:
22+
# connection_paras = BarcodeReader.init_lts_connection_parameters()
23+
## If DBR service is already built on your server, you can fill in the address of your server, or leave this property's default value.
24+
# connection_paras.main_server_url = "Input your own server url"
25+
# connection_paras.handshake_code = "Input your own handshake"
26+
# connection_paras.deployment_type = EnumDMDeploymentType.DM_DT_DESKTOP
27+
# connection_paras.uuid_generation_method = EnumDMUUIDGenerationMethod.DM_UUIDGM_RANDOM
28+
# try:
29+
# error = BarcodeReader.init_licesne_from_lts(connection_paras)
30+
# if error[0] != EnumErrorCode.DBR_OK:
31+
# print(error[1])
32+
# except BarcodeReaderError as bre:
33+
# print(bre)
2534

2635
error = reader.init_runtime_settings_with_file(json_file)
2736
if error[0] != EnumErrorCode.DBR_OK:

samples/test_AppendTemplateString.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,29 @@
55

66
#you can change the following four variables' value to your own value.
77
license_key = "Input your own license"
8-
#license_server = "Input the name/IP of the license server"
98
input_json_string = '{"ImageParameter" : { "BarcodeFormatIds" : [ "BF_ALL" ], "DeblurLevel" : 9, "Description" : "", "ExpectedBarcodesCount" : 0, "MaxAlgorithmThreadCount" : 4, "Name" : "IP_1", "Timeout" : 10000}, "Version" : "3.0"}'
109
append_json_string = '{"ImageParameter" : { "BarcodeFormatIds" : [ "BF_ALL" ], "DeblurLevel" : 9, "Description" : "", "ExpectedBarcodesCount" : 15, "MaxAlgorithmThreadCount" : 2, "Name" : "IP_2", "Timeout" : 20000}, "Version" : "3.0"}'
1110
#conflict_mode should be a value which is in EnumConflictMode.
1211
conflict_mode = EnumConflictMode.CM_OVERWRITE
1312

1413
reader = BarcodeReader()
1514

16-
# Apply for a trial license: https://www.dynamsoft.com/CustomerPortal/Portal/Triallicense.aspx
15+
# Apply for a trial license: https://www.dynamsoft.com/customer/license/trialLicense
1716
reader.init_license(license_key)
1817

19-
#reader.init_license_from_server(license_server, license_key)
20-
#license_content = reader.output_license_to_string()
21-
#reader.init_license_from_license_content(license_key, license_content)
18+
## The code snippet below shows how to use the full license in DBR 8.x:
19+
# connection_paras = BarcodeReader.init_lts_connection_parameters()
20+
## If DBR service is already built on your server, you can fill in the address of your server, or leave this property's default value.
21+
# connection_paras.main_server_url = "Input your own server url"
22+
# connection_paras.handshake_code = "Input your own handshake"
23+
# connection_paras.deployment_type = EnumDMDeploymentType.DM_DT_DESKTOP
24+
# connection_paras.uuid_generation_method = EnumDMUUIDGenerationMethod.DM_UUIDGM_RANDOM
25+
# try:
26+
# error = BarcodeReader.init_licesne_from_lts(connection_paras)
27+
# if error[0] != EnumErrorCode.DBR_OK:
28+
# print(error[1])
29+
# except BarcodeReaderError as bre:
30+
# print(bre)
2231

2332
error = reader.init_runtime_settings_with_string(input_json_string)
2433
if error[0] != EnumErrorCode.DBR_OK:

samples/test_DecodeFile.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,27 @@
66

77
# you can change the following variables' value to your own value.
88
license_key = "Input your own license"
9-
#license_server = "Input the name/IP of the license server"
109
json_file = r"Please input your own template path"
1110
image = r"Please input your own image path"
1211

1312
reader = BarcodeReader()
1413

15-
# Apply for a trial license: https://www.dynamsoft.com/CustomerPortal/Portal/Triallicense.aspx
14+
# Apply for a trial license: https://www.dynamsoft.com/customer/license/trialLicense
1615
reader.init_license(license_key)
1716

18-
#reader.init_license_from_server(license_server, license_key)
19-
#license_content = reader.output_license_to_string()
20-
#reader.init_license_from_license_content(license_key, license_content)
17+
## The code snippet below shows how to use the full license in DBR 8.x:
18+
# connection_paras = BarcodeReader.init_lts_connection_parameters()
19+
## If DBR service is already built on your server, you can fill in the address of your server, or leave this property's default value.
20+
# connection_paras.main_server_url = "Input your own server url"
21+
# connection_paras.handshake_code = "Input your own handshake"
22+
# connection_paras.deployment_type = EnumDMDeploymentType.DM_DT_DESKTOP
23+
# connection_paras.uuid_generation_method = EnumDMUUIDGenerationMethod.DM_UUIDGM_RANDOM
24+
# try:
25+
# error = BarcodeReader.init_licesne_from_lts(connection_paras)
26+
# if error[0] != EnumErrorCode.DBR_OK:
27+
# print(error[1])
28+
# except BarcodeReaderError as bre:
29+
# print(bre)
2130

2231
error = reader.init_runtime_settings_with_file(json_file)
2332

samples/test_DecodeFileInMemory.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,27 @@
55

66
# you can change the following variables' value to your own value.
77
license_key = "Input your own license"
8-
#license_server = "Input the name/IP of the license server"
98
json_file = r"Please input your own template path"
109
image = r"Please input your own image path"
1110

1211
reader = BarcodeReader()
1312

14-
# Apply for a trial license: https://www.dynamsoft.com/CustomerPortal/Portal/Triallicense.aspx
13+
# Apply for a trial license: https://www.dynamsoft.com/customer/license/trialLicense
1514
reader.init_license(license_key)
1615

17-
#reader.init_license_from_server(license_server, license_key)
18-
#license_content = reader.output_license_to_string()
19-
#reader.init_license_from_license_content(license_key, license_content)
16+
## The code snippet below shows how to use the full license in DBR 8.x:
17+
# connection_paras = BarcodeReader.init_lts_connection_parameters()
18+
## If DBR service is already built on your server, you can fill in the address of your server, or leave this property's default value.
19+
# connection_paras.main_server_url = "Input your own server url"
20+
# connection_paras.handshake_code = "Input your own handshake"
21+
# connection_paras.deployment_type = EnumDMDeploymentType.DM_DT_DESKTOP
22+
# connection_paras.uuid_generation_method = EnumDMUUIDGenerationMethod.DM_UUIDGM_RANDOM
23+
# try:
24+
# error = BarcodeReader.init_licesne_from_lts(connection_paras)
25+
# if error[0] != EnumErrorCode.DBR_OK:
26+
# print(error[1])
27+
# except BarcodeReaderError as bre:
28+
# print(bre)
2029

2130
error = reader.init_runtime_settings_with_file(json_file)
2231
if error[0] != EnumErrorCode.DBR_OK:

samples/test_DecodeImageBufferByOpencv.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,29 @@
77

88
# you can change the following variables' value to your own value.
99
license_key = "Input your own license"
10-
#license_server = "Input the name/IP of the license server"
1110
json_file = r"Please input your own template path"
1211
original_image = r"Please input your own image path"
1312

1413
image = cv2.imread(original_image)
1514

1615
reader = BarcodeReader()
1716

18-
# Apply for a trial license: https://www.dynamsoft.com/CustomerPortal/Portal/Triallicense.aspx
17+
# Apply for a trial license: https://www.dynamsoft.com/customer/license/trialLicense
1918
reader.init_license(license_key)
2019

21-
#reader.init_license_from_server(license_server, license_key)
22-
#license_content = reader.output_license_to_string()
23-
#reader.init_license_from_license_content(license_key, license_content)
20+
## The code snippet below shows how to use the full license in DBR 8.x:
21+
# connection_paras = BarcodeReader.init_lts_connection_parameters()
22+
## If DBR service is already built on your server, you can fill in the address of your server, or leave this property's default value.
23+
# connection_paras.main_server_url = "Input your own server url"
24+
# connection_paras.handshake_code = "Input your own handshake"
25+
# connection_paras.deployment_type = EnumDMDeploymentType.DM_DT_DESKTOP
26+
# connection_paras.uuid_generation_method = EnumDMUUIDGenerationMethod.DM_UUIDGM_RANDOM
27+
# try:
28+
# error = BarcodeReader.init_licesne_from_lts(connection_paras)
29+
# if error[0] != EnumErrorCode.DBR_OK:
30+
# print(error[1])
31+
# except BarcodeReaderError as bre:
32+
# print(bre)
2433

2534
error = reader.init_runtime_settings_with_file(json_file)
2635
if error[0] != EnumErrorCode.DBR_OK:

samples/test_DecodeImagesInFolder.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,27 @@
99

1010
# you can change the following variables' value to your own value.
1111
license_key = "Input your own license"
12-
#license_server = "Input the name/IP of the license server"
1312
json_file = r"Please input your own template path"
1413
image_folder = r"Please input your own image folder path"
1514

1615
reader = BarcodeReader()
1716

18-
# Apply for a trial license: https://www.dynamsoft.com/CustomerPortal/Portal/Triallicense.aspx
17+
# Apply for a trial license: https://www.dynamsoft.com/customer/license/trialLicense
1918
reader.init_license(license_key)
2019

21-
#reader.init_license_from_server(license_server, license_key)
22-
#license_content = reader.output_license_to_string()
23-
#reader.init_license_from_license_content(license_key, license_content)
20+
## The code snippet below shows how to use the full license in DBR 8.x:
21+
# connection_paras = BarcodeReader.init_lts_connection_parameters()
22+
## If DBR service is already built on your server, you can fill in the address of your server, or leave this property's default value.
23+
# connection_paras.main_server_url = "Input your own server url"
24+
# connection_paras.handshake_code = "Input your own handshake"
25+
# connection_paras.deployment_type = EnumDMDeploymentType.DM_DT_DESKTOP
26+
# connection_paras.uuid_generation_method = EnumDMUUIDGenerationMethod.DM_UUIDGM_RANDOM
27+
# try:
28+
# error = BarcodeReader.init_licesne_from_lts(connection_paras)
29+
# if error[0] != EnumErrorCode.DBR_OK:
30+
# print(error[1])
31+
# except BarcodeReaderError as bre:
32+
# print(bre)
2433

2534
error = reader.init_runtime_settings_with_file(json_file)
2635
if error[0] != EnumErrorCode.DBR_OK:

samples/test_DecodeIntermediateResults.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,27 @@
66

77
# you can change the following variables' value to your own value.
88
license_key = "Input your own license"
9-
#license_server = "Input the name/IP of the license server"
109
json_file = r"Please input your own template path"
1110
image = r"Please input your own image path"
1211

1312
reader = BarcodeReader()
1413

15-
# Apply for a trial license: https://www.dynamsoft.com/CustomerPortal/Portal/Triallicense.aspx
14+
# Apply for a trial license: https://www.dynamsoft.com/customer/license/trialLicense
1615
reader.init_license(license_key)
1716

18-
#reader.init_license_from_server(license_server, license_key)
19-
#license_content = reader.output_license_to_string()
20-
#reader.init_license_from_license_content(license_key, license_content)
17+
## The code snippet below shows how to use the full license in DBR 8.x:
18+
# connection_paras = BarcodeReader.init_lts_connection_parameters()
19+
## If DBR service is already built on your server, you can fill in the address of your server, or leave this property's default value.
20+
# connection_paras.main_server_url = "Input your own server url"
21+
# connection_paras.handshake_code = "Input your own handshake"
22+
# connection_paras.deployment_type = EnumDMDeploymentType.DM_DT_DESKTOP
23+
# connection_paras.uuid_generation_method = EnumDMUUIDGenerationMethod.DM_UUIDGM_RANDOM
24+
# try:
25+
# error = BarcodeReader.init_licesne_from_lts(connection_paras)
26+
# if error[0] != EnumErrorCode.DBR_OK:
27+
# print(error[1])
28+
# except BarcodeReaderError as bre:
29+
# print(bre)
2130

2231
settings = reader.get_runtime_settings()
2332
settings.intermediate_result_types = EnumIntermediateResultType.IRT_ORIGINAL_IMAGE | EnumIntermediateResultType.IRT_CONTOUR | EnumIntermediateResultType.IRT_BINARIZED_IMAGE

samples/test_DecodeLocalVideo.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
# you can change the following variables' value to your own value.
88
license_key = "Input your own license"
9-
#license_server = "Input the name/IP of the license server"
109
json_file = r"Please input your own template path"
1110
video_file = r"Please input your own video file path"
1211

@@ -102,12 +101,22 @@ def read_barcode():
102101

103102
print("-------------------start------------------------")
104103

105-
# Apply for a trial license: https://www.dynamsoft.com/CustomerPortal/Portal/Triallicense.aspx
104+
# Apply for a trial license: https://www.dynamsoft.com/customer/license/trialLicense
106105
reader.init_license(license_key)
107106

108-
#reader.init_license_from_server(license_server, license_key)
109-
#license_content = reader.output_license_to_string()
110-
#reader.init_license_from_license_content(license_key, license_content)
107+
## The code snippet below shows how to use the full license in DBR 8.x:
108+
# connection_paras = BarcodeReader.init_lts_connection_parameters()
109+
## If DBR service is already built on your server, you can fill in the address of your server, or leave this property's default value.
110+
# connection_paras.main_server_url = "Input your own server url"
111+
# connection_paras.handshake_code = "Input your own handshake"
112+
# connection_paras.deployment_type = EnumDMDeploymentType.DM_DT_DESKTOP
113+
# connection_paras.uuid_generation_method = EnumDMUUIDGenerationMethod.DM_UUIDGM_RANDOM
114+
# try:
115+
# error = BarcodeReader.init_licesne_from_lts(connection_paras)
116+
# if error[0] != EnumErrorCode.DBR_OK:
117+
# print(error[1])
118+
# except BarcodeReaderError as bre:
119+
# print(bre)
111120

112121
error = reader.init_runtime_settings_with_file(json_file)
113122
if error[0] != EnumErrorCode.DBR_OK:

0 commit comments

Comments
 (0)