DocumentScanner Constants

DocumentScanner defines and uses several constants. Each of the following constants enumerates the accepted string values for the associated properties.

The following constants are available as properties on an instance of DocumentScanner. The constants enumerate the accepted values for the associated properties.

Constant NameAccepted ValueDescription
DocumentScannerSource"INPUT_IMAGE", "PHOTO_LIBRARY", "DEVICE CAMERA"Possible sources for the document image to be scanned. Correlates with the imageSource property on the DocumentScannerOptions object.
Script"CHINESE", "DEVANAGARI", "JAPANESE", "KOREAN", "LATIN"Possible hint values for the script system used in the document to be scanned. Correlates with the scriptHint property on the DocumentScannerOptions object.

Correlates with the code property on the DocumentScannerFailure object.

Accepted ValueDescription
"USER_DISMISSED"The user dismissed the scanner.
"USER_DENIED_CAMERA_PERMISSION"A user denied permission to access the device camera when prompted.
"USER_DENIED_PHOTO_LIBRARY_PERMISSION"A user denied permission to access the device photo library when prompted.
"NO_SUPPORTED_CAMERA"The device doesn’t have a supported camera.
"INVALID_INPUT_IMAGE"The input image data can’t be read as an image.
"SERVICE_NOT_ENABLED"DocumentScanner is not enabled and cannot be used.
"UNKNOWN_REASON"An error occurred in the native code that isn’t related to permissions or hardware issues. More information is provided in the DocumentScannerFailure message.

See Also