Add the #DF24 Developer Keynote to your agenda. Join us in-person on 9/18 at 2:30 p.m. PT or on Salesforce+ at 5 p.m. PT for the must-see session built just for developers.

scan(options)

Use this function to start scanning a document.

A Promise object that resolves to an array containing one or more Document objects.

A rejected promise returns a DocumentScannerFailure.

Use this function to scan a document and handle the results of the scan.

  • The design pattern of returning an array containing a single Document object instead of just the Document object is intentional. This flexibility makes it easier to add future enhancements without causing existing code to break.
  • If an error occurs, the error is returned via a rejected promise. Handle errors in a catch clause.
  • When the user cancels a scan, the promise is rejected with a DocumentScannerFailure.code value of USER_DISMISSED.

See Also