yushulx/dynamsoft-sdk-skill

sdk-migration

Move a project onto Dynamsoft from ZXing, ML Kit, Scandit or an older DBR version.

Ver código fuente

Cómo usar

  1. Copia el comando y revisa el paquete antes de instalarlo en tu entorno de agente.
  2. Consulta las herramientas, credenciales y entornos necesarios en el documento original.
  3. Describe las entradas y el resultado deseado; contrasta la salida con las fuentes.
npx skills add https://github.com/yushulx/dynamsoft-sdk-skill --skill sdk-migration

Antes de empezar

  • La instalación no incluye suscripción al modelo, cuota API ni permisos sobre tus archivos.
  • Las estrellas e instalaciones reflejan actividad, no una prueba independiente de calidad o seguridad.
Documento original del Skill

Contenido del repositorio de origen con títulos, ejemplos, código, tablas, enlaces e imágenes preservados.

Migrating to Dynamsoft

Use this skill when the user is not starting fresh: they already scan with something else, or they have an aging Dynamsoft integration and want the current API.

Read references/migration.md for the full mapping tables and the per-library notes.

Identify the source, then map

SourceMigration shape
ZXing / zxing-jsDecode-and-return becomes CaptureVisionRouter.capture(); symbology hints become template settings
ML Kit (Android)BarcodeScanning processor becomes CaptureVisionRouter + CameraEnhancer
ScanditBarcodeCapture/SparkScan becomes CaptureVisionRouter + CameraView; licensing moves from Scandit account to a Dynamsoft key
DBR v9 and earlierclass and method renames around the Capture Vision router
DCV 2.xpreset template strings and result item types changed
RTU wrappers (BarcodeScanner, BarcodeReader)move to the core API for control

The three change patterns

  1. Decode API — most third-party libraries take an image and return a list of strings. The

Dynamsoft equivalent returns typed result items with text, format, and corner coordinates. Map the call once, then the rest of the app keeps working.

  1. Camera ownership — third-party libraries often own the camera. With Capture Vision you create

CameraView and CameraEnhancer yourself, which is why migration is mostly a wiring change in the view layer, not in the business logic.

  1. Licensing — every Dynamsoft SDK needs a key at startup. Add it once, from configuration; see

the license section below.

DBR v9 → v11 renames

v9v11
BarcodeReader.initLicense(key)LicenseManager.initLicense(key)
BarcodeReader.decode(image)CaptureVisionRouter.capture(image, template)
reader.getRuntimeSettings() / updateRuntimeSettings()template JSON via initSettings or a template file
results[i].BarcodeTextBarcodeResultItem.get_text() / .text

Do not invent bridge names for anything older than v9 — point at the official sample for that version instead of guessing.

RTU → core API

If the project uses BarcodeScanner.createInstance() or BarcodeReader.createInstance():

  1. Replace the instance with CaptureVisionRouter.createInstance().
  2. Create CameraView and CameraEnhancer explicitly — the wrapper was hiding them.
  3. Register addResultReceiver({ onDecodedBarcodesReceived }).
  4. Start with a template string ("ReadBarcodes_Default").
  5. Delete the wrapper's UI hooks; the core API does not render a preset UI.

The decode behaviour is preserved; what changes is who owns the pipeline.

Licence

Call get_trial_license with the product the migrated code targets (dbr or dcv, plus mrz, ddv, dwt if those are part of the app) and the edition matching the platform. If it returns status: "login_required", the browser window is waiting — have the user sign in and call again. Keep the key in configuration and show only licenseKeyMasked.

A migration also changes which licence is used: a Scandit account key becomes a Dynamsoft key, and that key is edition-scoped rather than product-scoped — one key covers the Dynamsoft products, but a desktop key will not license a browser runtime.

Migration checklist

  1. Inventory every call site of the old SDK (search the package name, not the class names).
  2. Replace the decode call and keep the old result shape behind an adapter so the rest of the app

does not change in the same commit.

  1. Move camera ownership out of the old library; add the view/enhancer pair.
  2. Add the Dynamsoft license init at startup.
  3. Delete the old dependency and its permissions/plist entries.
  4. Re-run the app's own scanning tests; compare decode results on the same fixtures before and after.

Pitfalls

  • Half-migrations — leaving the old library installed alongside the new one doubles camera

contention and confuses bundle size analysis.

  • Symbology drift — ZXing and ML Kit enable a different default set. If only some codes stop

decoding, set the formats explicitly in the template rather than assuming a regression.

  • Permissions — the old library's manifest/plist entries usually stay behind; remove them, and

confirm the new camera permission is declared.

  • Licence timing — initialising the SDK after the first capture call produces confusing failures.

Samples

Base migrated code on the closest of these official samples:

  • Migration reference: references/migration.md
  • Web (JavaScript/TypeScript): https://github.com/Dynamsoft/barcode-reader-javascript-samples
  • Android / iOS: https://github.com/Dynamsoft/barcode-reader-mobile-samples
  • Python / server: https://github.com/Dynamsoft/barcode-reader-python-samples
  • Other platforms and frameworks: https://github.com/Dynamsoft

Optional, when available: the full sample index lives in the dynamsoft-sdk skill (references/samples.md), also readable at https://github.com/yushulx/dynamsoft-sdk-skill/blob/main/skills/dynamsoft-sdk/references/samples.md.

del mismo repositorio

Más Skills

Todos los Skills
yushulx
Comunidad

capture-vision-desktop

Dynamsoft SDKs in server and desktop code with Python, .NET, Java, C++, Node.js and Electron. Covers barcode and QR decoding from images and PDFs, document normalization, MRZ parsing, result item typing, per-language license initialization, and the native asset and handle-release rules that break batch jobs.

Instalaciones / 1h
1
GitHub Stars
0
Actualizado
11 nov
yushulx
Comunidad

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.

Instalaciones / 1h
1
GitHub Stars
0
Actualizado
11 nov
yushulx
Comunidad

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.

Instalaciones / 1h
1
GitHub Stars
0
Actualizado
11 nov
yushulx
Comunidad

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.

Instalaciones / 1h
1
GitHub Stars
0
Actualizado
11 nov