chrome.documentScan

Description

Use the chrome.documentScan API to discover and retrieve images from attached paper document scanners.

The Document Scan API is designed to allow apps and extensions to view the content of paper documents on an attached document scanner.

Permissions

documentScan

Availability

Chrome 44+ ChromeOS only

Types

ScanOptions

Properties

  • maxImages

    number optional

    The number of scanned images allowed (defaults to 1).

  • mimeTypes

    string[] optional

    The MIME types that are accepted by the caller.

ScanResults

Properties

  • dataUrls

    string[]

    The data image URLs in a form that can be passed as the "src" value to an image tag.

  • mimeType

    string

    The MIME type of dataUrls.

Methods

scan()

Promise
chrome.documentScan.scan(
  options: ScanOptions,
  callback?: function,
)

Performs a document scan. On success, the PNG data will be sent to the callback.

Parameters

  • options

    Object containing scan parameters.

  • callback

    function optional

    The callback parameter looks like:

    (result: ScanResults)=>void

Returns

  • Promise<ScanResults>

    Chrome 96+

    Promises are supported in Manifest V3 and later, but callbacks are provided for backward compatibility. You cannot use both on the same function call. The promise resolves with the same type that is passed to the callback.