yushulx/dynamsoft-sdk-skill

document-viewer

View, annotate, reorder and export PDFs and images in a browser with Dynamsoft Document Viewer.

소스 보기

사용 방법

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

시작 전 확인

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

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

Dynamsoft Document Viewer (DDV)

Use this skill when the task is a document UI in the browser: render PDFs and images, page through them, annotate, rotate, reorder, delete, and export. DDV does not acquire images — for a physical scanner use web-twain; for camera capture use capture-vision-web.

Read references/integration.md for the full API reference: viewer types, annotation tools, page operations and export options.

Install

bash
npm install dynamsoft-document-viewer@5.0.1

Copy the dist assets (including the engine worker/wasm files) into the app's static directory, and serve them from the app origin.

License

DDV is licensed through Core, not through LicenseManager:

  1. get_trial_license with product: "ddv", package: "web".
  2. status: "login_required" — a browser window opened; ask the user to finish the sign-in and call

again.

  1. Keep the key in configuration, show only licenseKeyMasked, and assign it before init().
js
import Dynamsoft from "dynamsoft-document-viewer";

Dynamsoft.DDV.Core.license = window.DYNAMSOFT_LICENSE_KEY;   // never a literal
await Dynamsoft.DDV.Core.init();

The order is fixed: set Core.license then await Core.init(). Calling into a viewer before init() resolves throws.

Viewer vs editViewer

ComponentUse for
Dynamsoft.DDV.viewerRead-only presentation: page navigation, zoom, search
Dynamsoft.DDV.editViewerEditing: annotations, page delete/rotate/reorder, forms
js
const viewer = new Dynamsoft.DDV.EditViewer({
  container: document.getElementById("viewer"),
  group: "doc-group",
  uiConfig: Dynamsoft.DDV.UIConfig.default
});

const doc = Dynamsoft.DDV.documentManager.createDocument({ name: "scan", author: "app" });
await doc.load("https://example.com/input.pdf");

A Document belongs to a documentManager group; viewers render a group. Create the document once and attach it to the viewer rather than reloading the file per view.

Page and annotation operations

  • Pages: doc.getPages(), doc.insertPage(), doc.deletePages([...]), doc.movePages([...]),

doc.rotatePages([...], 90).

  • Annotations: doc.getAnnotations(), add through the edit viewer's annotation UI config, then

doc.saveAnnotations().

  • Export: doc.saveToPdf({ saveAnnotation: true }), or per-page images.

Indexes shift after a delete. Re-read the page list after any structural change instead of reusing cached indexes.

Scan → view → export

The common production flow pairs DWT and DDV:

  1. DWT acquires pages into its buffer.
  2. Each page is uploaded or converted to a blob.
  3. DDV loads the blobs as a document for review and annotation.
  4. DDV exports the final PDF.

Both SDKs take a license key: DWT assigns it to Dynamsoft.DWT.ProductKey, DDV to Dynamsoft.DDV.Core.license, and each must be set before its init() / Load() call. Request one key for the pair with get_trial_license product: "dwt-ddv"; the edition must match the runtime.

Pitfalls

  1. `Core.init()` before any viewer — constructing a viewer first is the most common crash.
  2. Assets — DDV loads wasm workers; a missing dist/engine directory produces a blank viewer

with console 404s rather than a visible error.

  1. PDF rendering needs the worker — if the page count renders but pages are blank, check the

worker/wasm requests first.

  1. Dispose documents and viewers on route change; otherwise the second visit to the page shows

the previous document's state.

  1. Licence scope — request the key with product: "ddv" (or "dwt-ddv" alongside Web TWAIN).

If Core.init() rejects a key that was issued for another product, request a ddv key rather than debugging the viewer.

Samples

  • Document Viewer samples: https://github.com/Dynamsoft/document-viewer-samples
  • Scan + view management app:

https://github.com/yushulx/web-twain-document-scan-management

  • Docs: https://www.dynamsoft.com/document-viewer/docs/
같은 저장소의 Skills

더 많은 Skills

모든 Skills
yushulx
커뮤니티

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.

1시간 설치 수
1
GitHub Stars
0
업데이트
11월 11일
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
커뮤니티

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일