Skip to content

Latest commit

 

History

History
38 lines (32 loc) · 1.8 KB

File metadata and controls

38 lines (32 loc) · 1.8 KB

Scanbot SDK – Node.js on Linux

Install the Scanbot SDK

Replace <SCANBOT_SDK_VERSION> with the actual version number of the SDK you want to install.

export SCANBOT_SDK_VERSION=<SCANBOT_SDK_VERSION>
npm install https://github.com/doo/scanbot-sdk-example-linux/releases/download/standalone-sdk%2Fv${SCANBOT_SDK_VERSION}/nodejs-scanbotsdk-${SCANBOT_SDK_VERSION}.tgz

Verify installation

node -e "console.log(require('scanbotsdk') ? 'Scanbot SDK loaded' : 'Error')"

Usage

The example supports four modes: scan, analyze, enhance, and parse.

npx ts-node src/index.ts scan <subcommand> --file <path/to/file.jpg> [--license <KEY>]
npx ts-node src/index.ts analyze <subcommand> --file <path/to/file.jpg> [--save <out.jpg>] [--license <KEY>]
npx ts-node src/index.ts enhance <subcommand> --file <path/to/file.jpg> [--save <out.jpg>] [--mask <path/to/mask.jpg>] [--license <KEY>]
npx ts-node src/index.ts parse <subcommand> --text "<input>" [--license <KEY>]

Example

npx ts-node src/index.ts scan barcode --file images/example.jpg --license <KEY>
npx ts-node src/index.ts analyze analyze_multi_page --file files/doc.pdf --license <KEY>
npx ts-node src/index.ts analyze crop_analyze --file images/doc.jpg --save out/crop.jpg --license <KEY>
npx ts-node src/index.ts enhance straighten_document --file images/doc.jpg --license <KEY>
npx ts-node src/index.ts enhance cleanup_document --file ../../test-scripts/test-images/highlighted.png --mask ../../test-scripts/test-images/highlighted_mask_001.png --save out/cleaned.jpg --license <KEY>
npx ts-node src/index.ts parse mrz --text "P<UTOERIKSSON<<ANNA<MARIA<<<<<<" --license <KEY>

API References

👉 Scanbot SDK Node.js API