yushulx/dynamsoft-sdk-skill

capture-vision-desktop

Dynamsoft SDKs in server and desktop code with Python, .NET, Java, C++, Node.js and Electron.

소스 보기

사용 방법

  1. 설치 명령을 복사하고 자신의 에이전트 환경에 설치하기 전에 소스 패키지를 확인하세요.
  2. 필요한 도구, 인증 정보, 지원 환경은 원본 문서에서 확인하세요.
  3. 입력과 원하는 산출물을 설명하고 출처와 결과를 대조하세요.
npx skills add https://github.com/yushulx/dynamsoft-sdk-skill --skill capture-vision-desktop

시작 전 확인

  • 설치에는 모델 구독, API 한도, 파일 접근 권한이 포함되지 않습니다.
  • 별점 수와 설치 수는 활동 지표이며 독립적인 품질·보안 검증이 아닙니다.
원본 Skill 문서

원본 저장소의 제목, 예시, 코드, 표, 링크, 이미지를 유지해 표시합니다.

Capture Vision on desktop and server

Same CaptureVisionRouter, one template string per capability:

CapabilityTemplate
Barcodes / QRReadBarcodes_Default
Document boundariesDetectDocumentBoundaries_Default
Boundaries + normalizationDetectAndNormalizeDocument_Default
MRZReadPassportAndId (ReadPassport, ReadId)
Text lines / labelsRecognizeTextLines_Default

There are no ready-to-use wrappers on these platforms — the router is the only entry point.

Packages

PlatformInstall
Pythonpip install dynamsoft-barcode-reader-bundle (11.6.5000) or dynamsoft-capture-vision-bundle (3.6.5000)
.NETdotnet add package Dynamsoft.DotNet.BarcodeReader.Bundle
Javacom.dynamsoft:dbr from https://download2.dynamsoft.com/maven/dbr/jar
C++desktop installer; link DynamsoftCore, DynamsoftLicense, DynamsoftCaptureVisionRouter
Node.jsnpm i dynamsoft-capture-vision-for-node (3.6.4003) + dynamsoft-capture-vision-for-node-model
Electronthe Node.js package, run in the main process

License

  1. get_trial_license with the product (dcv for the full bundle, dbr for barcode-only) and

package: "desktop".

  1. status: "login_required" means a browser window opened — ask the user to finish the Google

sign-in, then call again; the session is reused.

  1. Put licenseKey in DYNAMSOFT_LICENSE_KEY; show only licenseKeyMasked in chat.
  2. get_license_guide with platform (python, dotnet, java, cpp, nodejs) returns the call.
LanguageInitialise once, before any router
Pythonerror_code, error_message = LicenseManager.init_license(key)
.NETLicenseManager.InitLicense(key)
JavaLicenseManager.initLicense(key)
C++CLicenseManager::InitLicense(key, error, sizeof(error))
Node.jsLicenseManager.initLicense(key)

The key is edition-scoped, not product-scoped: a cross-platform or web key covers the same code across products, while a desktop key is rejected by a browser runtime with License mismatch: Browser requested. Ask for the edition that matches where the code runs.

Python: barcode from an image

Verified end-to-end (2026-11-10) with dynamsoft-barcode-reader-bundle 11.6.5000 and dynamsoft-capture-vision-bundle 3.6.5000.

python
import os
import sys

from dynamsoft_barcode_reader_bundle import (
    CaptureVisionRouter, EnumCapturedResultItemType, EnumErrorCode, EnumPresetTemplate, LicenseManager,
)


def scan(path: str) -> list[str]:
    error_code, error_message = LicenseManager.init_license(os.environ["DYNAMSOFT_LICENSE_KEY"])
    if error_code != EnumErrorCode.EC_OK:
        raise RuntimeError(f"license failed: {error_message}")

    router = CaptureVisionRouter()
    result = router.capture(path, EnumPresetTemplate.PT_READ_BARCODES.value)
    if result.get_error_code() != EnumErrorCode.EC_OK:
        raise RuntimeError(f"capture failed: {result.get_error_string()}")

    texts = []
    for item in result.get_items():
        if item.get_type() != EnumCapturedResultItemType.CRIT_BARCODE:
            continue
        texts.append(item.get_text())          # no cast needed
    return texts


if __name__ == "__main__":
    if len(sys.argv) != 2:
        raise SystemExit("usage: python scan.py <image-or-pdf>")
    found = scan(sys.argv[1])
    print("\n".join(found) if found else "no barcodes found")

Two details that trip up generated code:

  • The import path follows the package: dynamsoft_barcode_reader_bundle for the barcode bundle,

dynamsoft_capture_vision_bundle for Capture Vision. Class names are identical.

  • Do not cast result items in Python. Current bindings return concrete BarcodeResultItem

objects; BarcodeResultItem(item) raises TypeError. .NET and Java still need the cast, C++ needs CastTo() — see references/languages.md.

Other rules that matter:

  • EnumPresetTemplate.PT_READ_BARCODES.value is the template string; passing the enum does not work.
  • Zero items is a success, not an error: report "no barcodes found".
  • A multi-page PDF or TIFF yields several results from one capture() call.

Document and MRZ on desktop

Document normalization returns two item types, depending on the template:

python
result = router.capture(path, "DetectAndNormalizeDocument_Default")
for item in result.get_items():
    if item.get_type() == EnumCapturedResultItemType.CRIT_DETECTED_QUAD:
        print(item.get_location().points)                    # corners
    elif item.get_type() == EnumCapturedResultItemType.CRIT_NORMALIZED_IMAGE:
        item.save_to_file("page.jpg")                        # or get_image_data()

MRZ uses the parsed result item; read fields by name, do not parse the zone yourself:

python
result = router.capture(path, "ReadPassportAndId")
for item in result.get_items():
    if item.get_type() != EnumCapturedResultItemType.CRIT_PARSED_RESULT:
        continue
    print(item.get_code_type())                    # MRTD_TD1_ID | MRTD_TD2_ID | MRTD_TD3_PASSPORT
    print(item.get_field_value("documentNumber"))

ReadPassport on an ID card returns nothing — default to ReadPassportAndId.

Other languages

references/languages.md carries the .NET, Java, C++ and Node.js entry points, including the exact cast rules per binding.

Pitfalls

  1. Native assets ship with the package. Do not point C++/Node builds at a CDN; keep the installed

dist/lib tree and the model files next to the executable.

  1. License before router. A router created before init_license fails in ways that look like

decode errors.

  1. Check the result's error code, not just the process exit code.
  2. Release native handles (using, try-with-resources, Release()), or long batch jobs leak.
  3. Reuse one router across a batch of images; creating a router per file is correct but slow.
  4. Electron: initialise in the main process; the renderer cannot load the native module.

Verify

  • initLicense returns the success code (check it, do not ignore it).
  • One known-good image decodes and prints text.
  • An image with no barcode prints "no barcodes found" rather than throwing.
  • A second capture() on the same router still works.

Samples

  • Python barcode: https://github.com/Dynamsoft/barcode-reader-python-samples
  • Python Capture Vision: https://github.com/Dynamsoft/capture-vision-python-samples
  • .NET: https://github.com/Dynamsoft/barcode-reader-dotnet-samples
  • Java: https://github.com/Dynamsoft/barcode-reader-java-samples
  • C++: https://github.com/Dynamsoft/barcode-reader-c-cpp-samples
  • Node.js: https://github.com/Dynamsoft/capture-vision-nodejs-samples
  • Electron: https://github.com/Dynamsoft/barcode-reader-electron-nodejs
같은 저장소의 Skills

더 많은 Skills

모든 Skills
yushulx
커뮤니티

capture-vision-mobile

Dynamsoft SDKs in mobile apps. Covers barcode and QR scanning, MRZ passport and ID reading, document detection and normalization on Android, iOS, Flutter, React Native, .NET MAUI and Swift Package Manager, with licensing, camera permissions, lifecycle and the CaptureVisionRouter pipeline.

1시간 설치 수
1
GitHub Stars
0
업데이트
11월 11일
yushulx
커뮤니티

capture-vision-web

Dynamsoft SDKs in the browser with JavaScript and TypeScript. Covers barcode and QR scanning, MRZ and passport reading, document edge detection and normalization, label text recognition, PDF input, React/Vue/Angular/Next asset paths, licensing, and the camera and cleanup pitfalls that break web capture.

1시간 설치 수
1
GitHub Stars
0
업데이트
11월 11일
yushulx
커뮤니티

document-viewer

View, annotate, reorder and export PDFs and images in a browser with Dynamsoft Document Viewer. Covers Core licensing and init, the viewer/editViewer split, page and annotation operations, saving back to PDF, and pairing with Web TWAIN for a scan-to-edit flow.

1시간 설치 수
1
GitHub Stars
0
업데이트
11월 11일
yushulx
커뮤니티

dynamsoft-sdk

Choose and license the right Dynamsoft SDK before writing code. Covers Barcode Reader vs Capture Vision, Web TWAIN, Document Viewer, MRZ and Document Scanner boundaries, current package versions, how to get a trial license key through the license MCP, and which implementation skill to use next.

1시간 설치 수
1
GitHub Stars
0
업데이트
11월 11일