Skip to content

OCR and Barcode

The OCR module supports asynchronous export tasks and single-image text block extraction. The recognition module supports static barcode and QR detection.

OCR Export

json
{
  "request_id": "req-ocr-001",
  "method": "ocr.recognize",
  "params": {
    "input_upload_ids": ["img-..."],
    "format": "docx",
    "export_type": "multi-page",
    "output_path": "/tmp/output.docx",
    "languageType": "CHN_ENG"
  }
}

Supported formats: txt, pdf, docx, xlsx, ofd, and json. multi-page requires output_path; single-page requires output_dir or an output_path from which a directory can be inferred.

Query and cancel tasks:

json
{ "method": "ocr.get", "params": { "task_id": "ocr-..." } }
{ "method": "ocr.cancel", "params": { "task_id": "ocr-..." } }

Text Block Extraction

json
{
  "request_id": "req-extract-001",
  "method": "ocr.extract_text",
  "params": {
    "input_upload_id": "img-..."
  }
}

The response returns blocks[] with text, x, y, width, height, confidence, and font_size.

Barcode and QR Detection

json
{
  "request_id": "req-barcode-001",
  "method": "recognition.barcode_detect",
  "params": {
    "input_upload_id": "img-...",
    "formats": ["QR_CODE", "CODE_128"]
  }
}

When formats is empty, the provider uses its default detection set. The response returns barcodes[] with format, text, and corner points.

INFO

Realtime barcode detection belongs to video/capture provider behavior and is not a public Command method. The realtime barcode sample data in the demo is UI-only and should not be called as an API.

CZUR Open Platform Documentation