# Class DocumentScanResult

java.lang.Object
com.codename1.ai.vision.DocumentScanResult

public final class DocumentScanResult extends Object
Corrected document pages returned as encoded image data. Pages are ordered as detected and both construction and access make defensive copies, so the result can safely cross asynchronous boundaries. The still-image scanner is currently Apple-only; Android's ML Kit document API owns an interactive camera flow and does not implement this analyzer contract.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DocumentScanResult(byte[][] pages)`
  Creates a corrected document scan without backend metadata.
  `DocumentScanResult(byte[][] pages, VisionMetadata metadata)`
  Creates a corrected document scan with backend diagnostics.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `VisionMetadata`
  `getMetadata()`
  `byte[]`
  `getPage(int index)`
  `int`
  `getPageCount()`

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### DocumentScanResult

    public DocumentScanResult(byte[][] pages)
    Creates a corrected document scan without backend metadata.
    Parameters:
      `pages` - encoded corrected page images, deeply defensively copied

  - ### DocumentScanResult

    public DocumentScanResult(byte[][] pages, VisionMetadata metadata)
    Creates a corrected document scan with backend diagnostics.
    Parameters:
      `pages` - encoded corrected page images, deeply defensively copied
      `metadata` - backend details, or `null`

- ## Method Details

  - ### getPageCount

    public int getPageCount()
    Returns:
      number of corrected pages

  - ### getPage

    public byte[] getPage(int index)
    Parameters:
      `index` - zero-based page index
    Returns:
      defensive copy of that page's encoded image

  - ### getMetadata

    public VisionMetadata getMetadata()
    Returns:
      backend metadata, or `null` for manually created results