diff --git a/.gitignore b/.gitignore index c6dc1a6..671a121 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ dist /examples/official/9.x/zxing_zbar/__pycache__/*.pyc /examples/official/9.x/jupyter_notebook/.ipynb_checkpoints /examples/official/9.x/qt_gui/__pycache__/*.pyc +.DS_Store diff --git a/README.md b/README.md index 244cc52..58fcf6a 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,21 @@ # Python Extension: Barcode and QR Code SDK This project provides a CPython binding to the [Dynamsoft C/C++ Barcode Reader SDK v9.x](https://www.dynamsoft.com/barcode-reader/sdk-desktop-server/). It demonstrates how to build a **Python 1D/2D barcode SDK** package for `Windows`, `Linux` and `macOS` from scratch. Beyond desktop PCs, it's also compatible with embedded and IoT devices such as `Raspberry Pi` and `Jetson Nano`. You are **free** to customize the Python API for Dynamsoft Barcode Reader to suit your specific needs. -> Note: This project is an unofficial, community-maintained Python wrapper for the Dynamsoft Barcode SDK. For those seeking the most reliable and fully-supported solution, Dynamsoft offers an official Python package. Visit the [Dynamsoft Barcode Reader](https://pypi.org/project/dbr/) page on PyPI for more details. +> Note: This project is an unofficial, community-maintained Python wrapper for the Dynamsoft Barcode SDK. For those seeking the most reliable and fully-supported solution, Dynamsoft offers an official Python package. Visit the [Dynamsoft Capture Vision Bundle](https://pypi.org/project/dynamsoft-capture-vision-bundle/) page on PyPI for more details. -## About Dynamsoft Python Barcode SDK +## About Dynamsoft Capture Vision Bundle - Get a [30-day FREE trial license](https://www.dynamsoft.com/customer/license/trialLicense/?product=dcv&package=cross-platform) to activate the SDK. -- Install the official Python barcode SDK via `pip install dbr`. +- Install the SDK via `pip install dynamsoft-capture-vision-bundle`. ### Comparison Table | Feature | Unofficial Wrapper (Community) | Official Dynamsoft Python Barcode SDK | | --- | --- | --- | | Support | Community-driven, best effort | Official support from Dynamsoft | -| Documentation | README only | [Comprehensive Online Documentation](https://www.dynamsoft.com/barcode-reader/programming/python/index.html) | +| Documentation | README only | [Comprehensive Online Documentation](https://www.dynamsoft.com/capture-vision/docs/server/programming/python/?lang=python) | | API Coverage | Limited | Full API coverage | |Feature Updates| May lag behind the official SDK | First to receive new features | | Compatibility | Limited testing across environments| Thoroughly tested across all supported environments| +| OS Support | Windows, Linux, macOS | Windows, Linux, macOS | ## Supported Python Edition * Python 3.x diff --git a/examples/ctypes/README.md b/examples/ctypes/README.md index 93a3015..5135c63 100644 --- a/examples/ctypes/README.md +++ b/examples/ctypes/README.md @@ -29,7 +29,7 @@ This project explores an alternative approach to invoking C APIs from shared lib cmake --build . ``` -2. Get a valid license key from [Dynamsoft](https://www.dynamsoft.com/customer/license/trialLicense?product=dbr). Then, update the license key in the `success.py` file. +2. Get a valid license key from [Dynamsoft](https://www.dynamsoft.com/customer/license/trialLicense/?product=dcv&package=cross-platform). Then, update the license key in the `success.py` file. ```python license_key = b"LICENSE-KEY" diff --git a/examples/ctypes/failure.py b/examples/ctypes/failure.py index 00fea46..69f3db4 100644 --- a/examples/ctypes/failure.py +++ b/examples/ctypes/failure.py @@ -109,7 +109,7 @@ class TextResultArray(Structure): license_key = b"DLS2eyJoYW5kc2hha2VDb2RlIjoiMjAwMDAxLTE2NDk4Mjk3OTI2MzUiLCJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSIsInNlc3Npb25QYXNzd29yZCI6IndTcGR6Vm05WDJrcEQ5YUoifQ==" error_msg_buffer = create_string_buffer(256) error_msg_buffer_len = len(error_msg_buffer) -# https://www.dynamsoft.com/customer/license/trialLicense?product=dbr +# https://www.dynamsoft.com/customer/license/trialLicense/?product=dcv&package=cross-platform ret = DBR_InitLicense(license_key, error_msg_buffer, error_msg_buffer_len) print('initLicense: {}'.format(ret)) diff --git a/examples/ctypes/success.py b/examples/ctypes/success.py index eb21d15..331e75b 100644 --- a/examples/ctypes/success.py +++ b/examples/ctypes/success.py @@ -38,7 +38,7 @@ class ResultList(Structure): license_key = b"DLS2eyJoYW5kc2hha2VDb2RlIjoiMjAwMDAxLTE2NDk4Mjk3OTI2MzUiLCJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSIsInNlc3Npb25QYXNzd29yZCI6IndTcGR6Vm05WDJrcEQ5YUoifQ==" error_msg_buffer = create_string_buffer(256) error_msg_buffer_len = len(error_msg_buffer) -# https://www.dynamsoft.com/customer/license/trialLicense?product=dbr +# https://www.dynamsoft.com/customer/license/trialLicense/?product=dcv&package=cross-platform ret = DBR_InitLicense(license_key, error_msg_buffer, error_msg_buffer_len) # DBR_CreateInstance diff --git a/examples/official/10.x/file.py b/examples/official/10.x/file.py new file mode 100644 index 0000000..9214269 --- /dev/null +++ b/examples/official/10.x/file.py @@ -0,0 +1,74 @@ +import sys +from dynamsoft_capture_vision_bundle import * +import os +import cv2 +import numpy as np +from utils import * + +if __name__ == '__main__': + + print("**********************************************************") + print("Welcome to Dynamsoft Capture Vision - Barcode Sample") + print("**********************************************************") + + error_code, error_message = LicenseManager.init_license( + "DLS2eyJoYW5kc2hha2VDb2RlIjoiMjAwMDAxLTE2NDk4Mjk3OTI2MzUiLCJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSIsInNlc3Npb25QYXNzd29yZCI6IndTcGR6Vm05WDJrcEQ5YUoifQ==") + if error_code != EnumErrorCode.EC_OK and error_code != EnumErrorCode.EC_LICENSE_CACHE_USED: + print("License initialization failed: ErrorCode:", + error_code, ", ErrorString:", error_message) + else: + cvr_instance = CaptureVisionRouter() + while (True): + image_path = input( + ">> Input your image full path:\n" + ">> 'Enter' for sample image or 'Q'/'q' to quit\n" + ).strip('\'"') + + if image_path.lower() == "q": + sys.exit(0) + + if image_path == "": + image_path = "../../../images/multi.png" + + if not os.path.exists(image_path): + print("The image path does not exist.") + continue + result = cvr_instance.capture( + image_path, EnumPresetTemplate.PT_READ_BARCODES.value) + if result.get_error_code() != EnumErrorCode.EC_OK: + print("Error:", result.get_error_code(), + result.get_error_string()) + else: + cv_image = cv2.imread(image_path) + + items = result.get_items() + print('Found {} barcodes.'.format(len(items))) + for item in items: + format_type = item.get_format() + text = item.get_text() + print("Barcode Format:", format_type) + print("Barcode Text:", text) + + location = item.get_location() + x1 = location.points[0].x + y1 = location.points[0].y + x2 = location.points[1].x + y2 = location.points[1].y + x3 = location.points[2].x + y3 = location.points[2].y + x4 = location.points[3].x + y4 = location.points[3].y + del location + + cv2.drawContours( + cv_image, [np.intp([(x1, y1), (x2, y2), (x3, y3), (x4, y4)])], 0, (0, 255, 0), 2) + + cv2.putText(cv_image, text, (x1, y1 - 10), + cv2.FONT_HERSHEY_SIMPLEX, 0.5, (0, 0, 255), 2) + + cv2.imshow( + "Original Image with Detected Barcodes", cv_image) + cv2.waitKey(0) + cv2.destroyAllWindows() + + input("Press Enter to quit...") diff --git a/examples/official/10.x/requirements.txt b/examples/official/10.x/requirements.txt new file mode 100644 index 0000000..99ac112 --- /dev/null +++ b/examples/official/10.x/requirements.txt @@ -0,0 +1,2 @@ +dynamsoft-capture-vision-bundle +opencv-python \ No newline at end of file diff --git a/examples/official/10.x/utils.py b/examples/official/10.x/utils.py new file mode 100644 index 0000000..2578f63 --- /dev/null +++ b/examples/official/10.x/utils.py @@ -0,0 +1,138 @@ +from dynamsoft_capture_vision_bundle import * +import numpy as np + + +def convertImageData2Mat(normalized_image): + ba = bytearray(normalized_image.get_bytes()) + width = normalized_image.get_width() + height = normalized_image.get_height() + + channels = 3 + if normalized_image.get_image_pixel_format() == EnumImagePixelFormat.IPF_BINARY: + channels = 1 + all = [] + skip = normalized_image.stride * 8 - width + + index = 0 + n = 1 + for byte in ba: + + byteCount = 7 + while byteCount >= 0: + b = (byte & (1 << byteCount)) >> byteCount + + if index < normalized_image.stride * 8 * n - skip: + if b == 1: + all.append(255) + else: + all.append(0) + + byteCount -= 1 + index += 1 + + if index == normalized_image.stride * 8 * n: + n += 1 + + mat = np.array(all, dtype=np.uint8).reshape(height, width, channels) + return mat + + elif normalized_image.get_image_pixel_format() == EnumImagePixelFormat.IPF_GRAYSCALED: + channels = 1 + + mat = np.array(ba, dtype=np.uint8).reshape(height, width, channels) + + return mat + + +def convertMat2ImageData(mat): + if len(mat.shape) == 3: + height, width, channels = mat.shape + pixel_format = EnumImagePixelFormat.IPF_RGB_888 + else: + height, width = mat.shape + channels = 1 + pixel_format = EnumImagePixelFormat.IPF_GRAYSCALED + + stride = width * channels + imagedata = ImageData(mat.tobytes(), width, height, stride, pixel_format) + return imagedata + + +class MRZResult: + def __init__(self, item: ParsedResultItem): + self.doc_type = item.get_code_type() + self.raw_text = [] + self.doc_id = None + self.surname = None + self.given_name = None + self.nationality = None + self.issuer = None + self.gender = None + self.date_of_birth = None + self.date_of_expiry = None + if self.doc_type == "MRTD_TD3_PASSPORT": + if item.get_field_value("passportNumber") != None and item.get_field_validation_status("passportNumber") != EnumValidationStatus.VS_FAILED: + self.doc_id = item.get_field_value("passportNumber") + elif item.get_field_value("documentNumber") != None and item.get_field_validation_status("documentNumber") != EnumValidationStatus.VS_FAILED: + self.doc_id = item.get_field_value("documentNumber") + + line = item.get_field_value("line1") + if line is not None: + if item.get_field_validation_status("line1") == EnumValidationStatus.VS_FAILED: + line += ", Validation Failed" + self.raw_text.append(line) + line = item.get_field_value("line2") + if line is not None: + if item.get_field_validation_status("line2") == EnumValidationStatus.VS_FAILED: + line += ", Validation Failed" + self.raw_text.append(line) + line = item.get_field_value("line3") + if line is not None: + if item.get_field_validation_status("line3") == EnumValidationStatus.VS_FAILED: + line += ", Validation Failed" + self.raw_text.append(line) + + if item.get_field_value("nationality") != None and item.get_field_validation_status("nationality") != EnumValidationStatus.VS_FAILED: + self.nationality = item.get_field_value("nationality") + if item.get_field_value("issuingState") != None and item.get_field_validation_status("issuingState") != EnumValidationStatus.VS_FAILED: + self.issuer = item.get_field_value("issuingState") + if item.get_field_value("dateOfBirth") != None and item.get_field_validation_status("dateOfBirth") != EnumValidationStatus.VS_FAILED: + self.date_of_birth = item.get_field_value("dateOfBirth") + if item.get_field_value("dateOfExpiry") != None and item.get_field_validation_status("dateOfExpiry") != EnumValidationStatus.VS_FAILED: + self.date_of_expiry = item.get_field_value("dateOfExpiry") + if item.get_field_value("sex") != None and item.get_field_validation_status("sex") != EnumValidationStatus.VS_FAILED: + self.gender = item.get_field_value("sex") + if item.get_field_value("primaryIdentifier") != None and item.get_field_validation_status("primaryIdentifier") != EnumValidationStatus.VS_FAILED: + self.surname = item.get_field_value("primaryIdentifier") + if item.get_field_value("secondaryIdentifier") != None and item.get_field_validation_status("secondaryIdentifier") != EnumValidationStatus.VS_FAILED: + self.given_name = item.get_field_value("secondaryIdentifier") + + def to_string(self): + msg = (f"Raw Text:\n") + for index, line in enumerate(self.raw_text): + msg += (f"\tLine {index + 1}: {line}\n") + msg += (f"Parsed Information:\n" + f"\tDocumentType: {self.doc_type or ''}\n" + f"\tDocumentID: {self.doc_id or ''}\n" + f"\tSurname: {self.surname or ''}\n" + f"\tGivenName: {self.given_name or ''}\n" + f"\tNationality: {self.nationality or ''}\n" + f"\tIssuingCountryorOrganization: {self.issuer or ''}\n" + f"\tGender: {self.gender or ''}\n" + f"\tDateofBirth(YYMMDD): {self.date_of_birth or ''}\n" + f"\tExpirationDate(YYMMDD): {self.date_of_expiry or ''}\n") + return msg + + +def print_results(result: ParsedResult) -> None: + tag = result.get_original_image_tag() + if isinstance(tag, FileImageTag): + print("File:", tag.get_file_path()) + if result.get_error_code() != EnumErrorCode.EC_OK: + print("Error:", result.get_error_string()) + else: + items = result.get_items() + print("Parsed", len(items), "MRZ Zones.") + for item in items: + mrz_result = MRZResult(item) + print(mrz_result.to_string()) diff --git a/examples/official/9.x/django/README.md b/examples/official/9.x/django/README.md index ea8b84a..9c11df4 100644 --- a/examples/official/9.x/django/README.md +++ b/examples/official/9.x/django/README.md @@ -20,7 +20,7 @@ This sample demonstrates how to create an online Barcode and QR Code Reader usin - **SDK License** - To use the Dynamsoft Barcode Reader SDK, request a [30-day free trial license](https://www.dynamsoft.com/customer/license/trialLicense/?product=dbr). + To use the Dynamsoft Barcode Reader SDK, request a [30-day free trial license](https://www.dynamsoft.com/customer/license/trialLicense/?product=dcv&package=cross-platform). ## Usage 1. Set the license key in `scanbarcode/views.py`: diff --git a/examples/official/9.x/django/scanbarcode/views.py b/examples/official/9.x/django/scanbarcode/views.py index ae464fd..bc4093c 100644 --- a/examples/official/9.x/django/scanbarcode/views.py +++ b/examples/official/9.x/django/scanbarcode/views.py @@ -8,17 +8,21 @@ from dbr import * import json -# Apply for a trial license: https://www.dynamsoft.com/customer/license/trialLicense?product=dbr -BarcodeReader.init_license("DLS2eyJoYW5kc2hha2VDb2RlIjoiMjAwMDAxLTE2NDk4Mjk3OTI2MzUiLCJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSIsInNlc3Npb25QYXNzd29yZCI6IndTcGR6Vm05WDJrcEQ5YUoifQ==") +# Apply for a trial license: https://www.dynamsoft.com/customer/license/trialLicense/?product=dcv&package=cross-platform +BarcodeReader.init_license( + "DLS2eyJoYW5kc2hha2VDb2RlIjoiMjAwMDAxLTE2NDk4Mjk3OTI2MzUiLCJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSIsInNlc3Npb25QYXNzd29yZCI6IndTcGR6Vm05WDJrcEQ5YUoifQ==") reader = BarcodeReader() + def index(request): - return render(request, 'scanbarcode/index.html') + return render(request, 'scanbarcode/index.html') + def upload(request): out = "No barcode found" if request.method == 'POST': - filePath = handle_uploaded_file(request.FILES['RemoteFile'], str(request.FILES['RemoteFile'])) + filePath = handle_uploaded_file( + request.FILES['RemoteFile'], str(request.FILES['RemoteFile'])) try: text_results = reader.decode_file(filePath) if text_results != None: @@ -31,7 +35,6 @@ def upload(request): print(bre) return HttpResponse(out) - return HttpResponse(out) # image = Image() # image.name = request.FILES['RemoteFile'].name @@ -41,6 +44,7 @@ def upload(request): return HttpResponse(out) + def handle_uploaded_file(file, filename): if not os.path.exists('upload/'): os.mkdir('upload/') diff --git a/examples/official/9.x/flet_chat_gemini/README.md b/examples/official/9.x/flet_chat_gemini/README.md index a4dc444..94ccb11 100644 --- a/examples/official/9.x/flet_chat_gemini/README.md +++ b/examples/official/9.x/flet_chat_gemini/README.md @@ -20,7 +20,7 @@ pip install -r requirements.txt ![Gemini API key](https://www.dynamsoft.com/codepool/img/2024/09/gemini-api-key.png) -2. Request a [free trial license](https://www.dynamsoft.com/customer/license/trialLicense?product=dbr) for Dynamsoft Barcode Reader and replace the value of `LICENSE-KEY` in `chatbot.py`. +2. Request a [free trial license](https://www.dynamsoft.com/customer/license/trialLicense/?product=dcv&package=cross-platform) for Dynamsoft Barcode Reader and replace the value of `LICENSE-KEY` in `chatbot.py`. ```python license_key = "LICENSE-KEY" diff --git a/examples/official/9.x/jupyter_notebook/barcode_scanning.ipynb b/examples/official/9.x/jupyter_notebook/barcode_scanning.ipynb index e65151e..d616b76 100644 --- a/examples/official/9.x/jupyter_notebook/barcode_scanning.ipynb +++ b/examples/official/9.x/jupyter_notebook/barcode_scanning.ipynb @@ -69,7 +69,7 @@ "id": "49130381" }, "source": [ - "[![](https://img.shields.io/badge/Get-30--day%20FREE%20Trial%20License-blue)](https://www.dynamsoft.com/customer/license/trialLicense/?product=dbr)" + "[![](https://img.shields.io/badge/Get-30--day%20FREE%20Trial%20License-blue)](https://www.dynamsoft.com/customer/license/trialLicense/?product=dcv&package=cross-platform)" ] }, { diff --git a/examples/official/9.x/nonstandard_1D_barcode/README.md b/examples/official/9.x/nonstandard_1D_barcode/README.md index ce13120..9118f07 100644 --- a/examples/official/9.x/nonstandard_1D_barcode/README.md +++ b/examples/official/9.x/nonstandard_1D_barcode/README.md @@ -5,7 +5,7 @@ This sample demonstrates how to use the [Dynamsoft Barcode Reader SDK](https://w Python 3.x ## Prerequisites -- Obtain a [Dynamsoft Barcode Reader trial license](https://www.dynamsoft.com/customer/license/trialLicense/?product=dbr) +- Obtain a [Dynamsoft Barcode Reader trial license](https://www.dynamsoft.com/customer/license/trialLicense/?product=dcv&package=cross-platform) - Install the Dynamsoft Barcode Reader SDK for Python: ```bash diff --git a/examples/official/9.x/qrcode_template/README.md b/examples/official/9.x/qrcode_template/README.md index 5b1e70b..12c93b7 100644 --- a/examples/official/9.x/qrcode_template/README.md +++ b/examples/official/9.x/qrcode_template/README.md @@ -9,7 +9,7 @@ pip install -r requirements.txt ``` ## Usage -1. Obtain a [30-day FREE trial license](https://www.dynamsoft.com/customer/license/trialLicense?product=dbr) for the Dynamsoft Barcode Reader SDK and save the license key in a `license.txt` file. +1. Obtain a [30-day FREE trial license](https://www.dynamsoft.com/customer/license/trialLicense/?product=dcv&package=cross-platform) for the Dynamsoft Barcode Reader SDK and save the license key in a `license.txt` file. 2. Run the sample scripts: diff --git a/examples/official/9.x/qt_gui/README.md b/examples/official/9.x/qt_gui/README.md index fef2d7f..cd5e66f 100644 --- a/examples/official/9.x/qt_gui/README.md +++ b/examples/official/9.x/qt_gui/README.md @@ -21,7 +21,7 @@ This is a cross-platform GUI barcode reader application built with `Python 3`, ` python3 -m pip install dbr ``` -- [Dynamsoft Barcode SDK License](https://www.dynamsoft.com/customer/license/trialLicense?product=dbr) +- [Dynamsoft Barcode SDK License](https://www.dynamsoft.com/customer/license/trialLicense/?product=dcv&package=cross-platform) ## Usage diff --git a/examples/official/9.x/requirements.txt b/examples/official/9.x/requirements.txt new file mode 100644 index 0000000..21a096b --- /dev/null +++ b/examples/official/9.x/requirements.txt @@ -0,0 +1,2 @@ +dbr +opencv-python \ No newline at end of file diff --git a/examples/official/9.x/webcam/README.md b/examples/official/9.x/webcam/README.md index 044ebad..e99f8cc 100644 --- a/examples/official/9.x/webcam/README.md +++ b/examples/official/9.x/webcam/README.md @@ -2,7 +2,7 @@ This repository provides samples demonstrating how to create a simple barcode and QR code reader using a webcam in Python. The OpenCV Stitcher API is utilized to stitch multiple barcode and QR code results together. ## License Activation -To activate the [Dynamsoft Barcode Reader SDK](https://www.dynamsoft.com/barcode-reader/sdk-desktop-server/), obtain a desktop license key from [here](https://www.dynamsoft.com/customer/license/trialLicense?product=dbr): +To activate the [Dynamsoft Barcode Reader SDK](https://www.dynamsoft.com/barcode-reader/sdk-desktop-server/), obtain a desktop license key from [here](https://www.dynamsoft.com/customer/license/trialLicense/?product=dcv&package=cross-platform): ```python BarcodeReader.init_license("LICENSE-KEY") diff --git a/examples/official/9.x/yolo_qr/README.md b/examples/official/9.x/yolo_qr/README.md index 877c5f1..092b633 100644 --- a/examples/official/9.x/yolo_qr/README.md +++ b/examples/official/9.x/yolo_qr/README.md @@ -13,7 +13,7 @@ This repository provides samples demonstrating how to detect QR codes using **YO ``` pip install dbr ``` -- Obtain a [Dynamsoft Barcode Reader trial license](https://www.dynamsoft.com/customer/license/trialLicense?product=dbr) and update your code with the provided license key: +- Obtain a [Dynamsoft Barcode Reader trial license](https://www.dynamsoft.com/customer/license/trialLicense/?product=dcv&package=cross-platform) and update your code with the provided license key: ```python from dbr import * diff --git a/examples/official/9.x/zxing_zbar/README.md b/examples/official/9.x/zxing_zbar/README.md index d23ed0c..d7d083d 100644 --- a/examples/official/9.x/zxing_zbar/README.md +++ b/examples/official/9.x/zxing_zbar/README.md @@ -14,7 +14,7 @@ pip install -r requirements.txt ## Usage -1. Obtain a [Dynamsoft Barcode Reader trial license](https://www.dynamsoft.com/customer/license/trialLicense/?product=dbr) and update the code with the license key in `app.py`. +1. Obtain a [Dynamsoft Barcode Reader trial license](https://www.dynamsoft.com/customer/license/trialLicense/?product=dcv&package=cross-platform) and update the code with the license key in `app.py`. ```python BarcodeReader.init_license('LICENSE-KEY') diff --git a/images/multi.png b/images/multi.png new file mode 100644 index 0000000..9c21889 Binary files /dev/null and b/images/multi.png differ diff --git a/src/barcodeQrSDK.cpp b/src/barcodeQrSDK.cpp index 034a222..ea80f3d 100644 --- a/src/barcodeQrSDK.cpp +++ b/src/barcodeQrSDK.cpp @@ -63,7 +63,7 @@ static PyObject *initLicense(PyObject *obj, PyObject *args) } char errorMsgBuffer[512]; - // Click https://www.dynamsoft.com/customer/license/trialLicense/?product=dbr to get a trial license. + // Click https://www.dynamsoft.com/customer/license/trialLicense/?product=dcv&package=cross-platform to get a trial license. int ret = DBR_InitLicense(pszLicense, errorMsgBuffer, 512); printf("DBR_InitLicense: %s\n", errorMsgBuffer);