Skip to content

SANE Scanners

sane.* is the Linux-only scanner capability domain in SDK Open. It covers third-party SANE scanner discovery, hotplug watching, session open, option reads and writes, option profiles, and scan tasks.

Platform Behavior

SANE support is only available on Linux runtimes. Non-Linux runtimes keep the sane.* methods visible so clients can keep one integration shape. In that case, sane.status returns available=false, and other sane.* methods return a SANE unavailable error.

Device List

sane.list returns only devices recognized by a SANE backend and openable by default. USB/finder detections are used only to trigger hotplug refreshes and diagnostics.

To inspect raw finder detections, pass:

json
{
  "include_detected": true
}

The response additionally includes detected_devices and detected_count. The Demo keeps these diagnostic rows out of the scan device list so one scanner is not displayed twice.

Scan Tasks

sane.scan is an async task submission method. It returns accepted, task_id, and task immediately. Track the task with:

  • sane.scan_get: query task status.
  • sane.scan_cancel: cancel the task.
  • sane.scan_changed: receive task events, including status, page progress, conversion stage, completion, failure, or cancellation.

When no output directory is provided, scanned files are written under the SDK task asset directory. Its root can be overridden with SDK_OPEN_WORK_DIR; the legacy client work directory is not used.

The SDK does not expose a synthetic preview mode or page mode for SANE. Page behavior follows device options:

  • Flatbed-like source values scan one page.
  • ADF, Feeder, or Duplex-like source values keep pulling pages until the device reports no documents.

sane.scan also accepts an image enhancement pipeline. Scanned pages are enhanced before export.

CZUR Open Platform Documentation