Documentation: Chrome Document Scan API
A promise-based wrapper for the Chrome documentScan API.
- cancelDocScanning(job)
- closeDocScanner(scannerHandle)
- getDocScannerOptionGroups(scannerHandle)
- getDocScannerList(filter)
- openDocScanner(scannerId)
- readDocScanningData(job)
- docScanning(options)
- setDocScannerOptions(scannerHandle, options)
- startDocScanning(scannerHandle, options)
cancelDocScanning(job: string): Promise<chrome.documentScan.CancelScanResponse<string>>
Cancels an ongoing document scan job.
closeDocScanner(scannerHandle: string): Promise<chrome.documentScan.CloseScannerResponse<string>>
Closes the document scanner associated with the specified scanner handle.
getDocScannerOptionGroups(scannerHandle: string): Promise<chrome.documentScan.GetOptionGroupsResponse<string>>
Retrieves the available option groups for the specified document scanner.
getDocScannerList(filter: chrome.documentScan.DeviceFilter): Promise<chrome.documentScan.GetScannerListResponse>
Fetches a list of document scanners matching the given filter criteria.
openDocScanner(scannerId: string): Promise<chrome.documentScan.OpenScannerResponse<string>>
Opens a document scanner by its ID, returning a handle for further operations.
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(options: chrome.documentScan.ScanOptions): Promise<chrome.documentScan.ScanResults>
Performs a one-shot document scan with the specified options and returns the results.
setDocScannerOptions(
scannerHandle: string,
options: chrome.documentScan.OptionSetting[]
): Promise<chrome.documentScan.SetOptionsResponse<string>>
Sets multiple scanner options on the given scanner handle.
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.