Skip to content

Latest commit

 

History

History
115 lines (74 loc) · 3.05 KB

File metadata and controls

115 lines (74 loc) · 3.05 KB

documentScan

Documentation: Chrome Document Scan API

A promise-based wrapper for the Chrome documentScan API.

Methods


cancelDocScanning

cancelDocScanning(job: string): Promise<chrome.documentScan.CancelScanResponse<string>>

Cancels an ongoing document scan job.

closeDocScanner

closeDocScanner(scannerHandle: string): Promise<chrome.documentScan.CloseScannerResponse<string>>

Closes the document scanner associated with the specified scanner handle.

getDocScannerOptionGroups

getDocScannerOptionGroups(scannerHandle: string): Promise<chrome.documentScan.GetOptionGroupsResponse<string>>

Retrieves the available option groups for the specified document scanner.

getDocScannerList

getDocScannerList(filter: chrome.documentScan.DeviceFilter): Promise<chrome.documentScan.GetScannerListResponse>

Fetches a list of document scanners matching the given filter criteria.

openDocScanner

openDocScanner(scannerId: string): Promise<chrome.documentScan.OpenScannerResponse<string>>

Opens a document scanner by its ID, returning a handle for further operations.

readDocScanningData

readDocScanningData(job: string): Promise<chrome.documentScan.ReadScanDataResponse<string>>

Reads the next chunk of data from an ongoing scan job. Note: A successful response with zero-length data indicates the scanner is still working; try again shortly. When the job completes, the response result will be EOF and may contain a final data chunk.

docScanning

docScanning(options: chrome.documentScan.ScanOptions): Promise<chrome.documentScan.ScanResults>

Performs a one-shot document scan with the specified options and returns the results.

setDocScannerOptions

setDocScannerOptions(
  scannerHandle: string,
  options: chrome.documentScan.OptionSetting[]
): Promise<chrome.documentScan.SetOptionsResponse<string>>

Sets multiple scanner options on the given scanner handle.

startDocScanning

startDocScanning(
  scannerHandle: string,
  options: chrome.documentScan.StartScanOptions
): Promise<chrome.documentScan.StartScanResponse<string>>

Starts a scan on an open scanner using the provided options and returns a job handle.