ScanResult

ScanResult

ScanResult is the result of the last scan operation. It contains the scanned page images, the image type, and the tiff file or pdf file if the image type is tiff or pdf.

Constructor

# new ScanResult(images, scanFormatType, tiffFile, pdfFile, imageType)

Parameters:
Name Type Description
images Array

An array of base64 encoded scanned page images.

scanFormatType String

The type of the scan. Can be jpeg, bmp, png, pdf or tiff.

tiffFile String

The base64 encoded tiff file. Only available if scanFormatType is tiff.

pdfFile String

The base64 encoded pdf file. Only available if scanFormatType is pdf.

imageType String

The type of the single image. Can be jpeg, bmp or png.

Members

# imageType :String

The type of the single image. For scanFormatType = 'tiff','pdf' or 'jpeg' it is jpeg. For 'bmp' it is 'bmp'. For 'png' it is 'png'.

Type:
  • String

# images :Array

An array of base64 encoded scanned page images.

Type:
  • Array

# pdfFile :String

The base64 encoded pdf file. Only available if scanFormatType is pdf.

Type:
  • String

# scanFormatType :String

The scan format type. Can be jpeg, bmp, png, pdf or tiff.

Type:
  • String

# tiffFile :String

The base64 encoded tiff file. Only available if scanFormatType is tiff.

Type:
  • String

Methods

# getImageDataAsUint8Array(pageNumber) → {Uint8Array}

Get image as Uint8Array for selected page number.

Parameters:
Name Type Description
pageNumber Number

The page number to get the image data from.

Returns:

The image bytes

Type
Uint8Array

# getImageDataSrc(pageNumber) → {String}

Get image data source URL for selected page number. Useful for displaying the image in an canvas or img element.

Parameters:
Name Type Description
pageNumber Number

The page number to get the image data from.

Returns:

Data source URL with the base64 encoded image data.

Type
String

# pageCount() → {Number}

Returns:

The number of pages in the scan result.

Type
Number