GmsDocumentScanningResult
Stay organized with collections
Save and categorize content based on your preferences.
Result for document scanning.
Inherited Constant Summary
From interface android.os.Parcelable
int |
CONTENTS_FILE_DESCRIPTOR |
|
int |
PARCELABLE_WRITE_RETURN_VALUE |
|
Public Constructor Summary
Inherited Method Summary
From class java.lang.Object
Object
|
clone()
|
boolean |
|
void |
finalize()
|
final Class<?>
|
getClass()
|
int |
hashCode()
|
final void |
notify()
|
final void |
notifyAll()
|
String
|
toString()
|
final void |
wait(long arg0, int arg1)
|
final void |
wait(long arg0)
|
final void |
wait()
|
From interface android.os.Parcelable
abstract int |
describeContents()
|
abstract void |
writeToParcel( Parcel arg0,
int arg1)
|
Public Constructors
public GmsDocumentScanningResult ()
Public Methods
Gets the
GmsDocumentScanningResult
from the scanning Activity result data.
Returns null
if fails to extract or construct the result.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[null,null,["Last updated 2024-10-31 UTC."],[[["\u003cp\u003e\u003ccode\u003eGmsDocumentScanningResult\u003c/code\u003e stores the result of a document scanning operation, potentially including scanned pages and a PDF.\u003c/p\u003e\n"],["\u003cp\u003eYou can retrieve an instance of this class from the Activity result data using \u003ccode\u003efromActivityResultIntent\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eAccess the scanned pages using \u003ccode\u003egetPages()\u003c/code\u003e if JPEG output was specified in the scanner options.\u003c/p\u003e\n"],["\u003cp\u003eObtain the PDF result with \u003ccode\u003egetPdf()\u003c/code\u003e if PDF output was specified in the scanner options.\u003c/p\u003e\n"]]],["`GmsDocumentScanningResult` represents the outcome of a document scan. Key actions include retrieving the result from scanning activity data via `fromActivityResultIntent`. It provides methods to access scanned pages as a list of `GmsDocumentScanningResult.Page` objects through `getPages`, which is available if JPEG format was specified. Also, you can retrieve the PDF result using `getPdf`, but only if the PDF format was chosen in the scanner options. The class can also perform `writeToParcel` and `describeContents` actions.\n"],null,["# GmsDocumentScanningResult\n\npublic abstract class **GmsDocumentScanningResult** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nimplements [Parcelable](//developer.android.com/reference/android/os/Parcelable.html) \nResult for document scanning. \n\n### Nested Class Summary\n\n|-------|---|---|--------------------------------------------|\n| class | [GmsDocumentScanningResult.Page](/android/reference/com/google/mlkit/vision/documentscanner/GmsDocumentScanningResult.Page) || Represents a page in the scanning result. |\n| class | [GmsDocumentScanningResult.Pdf](/android/reference/com/google/mlkit/vision/documentscanner/GmsDocumentScanningResult.Pdf) || Represents the PDF in the scanning result. |\n\n### Inherited Constant Summary\n\nFrom interface android.os.Parcelable \n\n|-----|-------------------------------|---|\n| int | CONTENTS_FILE_DESCRIPTOR | |\n| int | PARCELABLE_WRITE_RETURN_VALUE | |\n\n### Public Constructor Summary\n\n|---|-------------------------------------------------------------------------------------------------------------------------------------------------|\n| | [GmsDocumentScanningResult](/android/reference/com/google/mlkit/vision/documentscanner/GmsDocumentScanningResult#GmsDocumentScanningResult())() |\n\n### Public Method Summary\n\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| static [GmsDocumentScanningResult](/android/reference/com/google/mlkit/vision/documentscanner/GmsDocumentScanningResult) | [fromActivityResultIntent](/android/reference/com/google/mlkit/vision/documentscanner/GmsDocumentScanningResult#fromActivityResultIntent(android.content.Intent))([Intent](//developer.android.com/reference/android/content/Intent.html) data) Gets the [GmsDocumentScanningResult](/android/reference/com/google/mlkit/vision/documentscanner/GmsDocumentScanningResult) from the scanning Activity result data. |\n| abstract [List](//developer.android.com/reference/java/util/List.html)\\\u003c[GmsDocumentScanningResult.Page](/android/reference/com/google/mlkit/vision/documentscanner/GmsDocumentScanningResult.Page)\\\u003e | [getPages](/android/reference/com/google/mlkit/vision/documentscanner/GmsDocumentScanningResult#getPages())() Returns the scanned pages or `null` if [GmsDocumentScannerOptions.RESULT_FORMAT_JPEG](/android/reference/com/google/mlkit/vision/documentscanner/GmsDocumentScannerOptions#RESULT_FORMAT_JPEG) was not specified when creating the scanner options. |\n| abstract [GmsDocumentScanningResult.Pdf](/android/reference/com/google/mlkit/vision/documentscanner/GmsDocumentScanningResult.Pdf) | [getPdf](/android/reference/com/google/mlkit/vision/documentscanner/GmsDocumentScanningResult#getPdf())() Returns the PDF result or `null` if [GmsDocumentScannerOptions.RESULT_FORMAT_PDF](/android/reference/com/google/mlkit/vision/documentscanner/GmsDocumentScannerOptions#RESULT_FORMAT_PDF) was not specified when creating the scanner options. |\n\n### Inherited Method Summary\n\nFrom class java.lang.Object \n\n|----------------------------------------------------------------------------|--------------------------------------------------------------------------------|\n| [Object](//developer.android.com/reference/java/lang/Object.html) | clone() |\n| boolean | equals([Object](//developer.android.com/reference/java/lang/Object.html) arg0) |\n| void | finalize() |\n| final [Class](//developer.android.com/reference/java/lang/Class.html)\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| [String](//developer.android.com/reference/java/lang/String.html) | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nFrom interface android.os.Parcelable \n\n|---------------|--------------------------------------------------------------------------------------------------|\n| abstract int | describeContents() |\n| abstract void | writeToParcel([Parcel](//developer.android.com/reference/android/os/Parcel.html) arg0, int arg1) |\n\nPublic Constructors\n-------------------\n\n#### public **GmsDocumentScanningResult** ()\n\nPublic Methods\n--------------\n\n#### public static [GmsDocumentScanningResult](/android/reference/com/google/mlkit/vision/documentscanner/GmsDocumentScanningResult) **fromActivityResultIntent** ([Intent](//developer.android.com/reference/android/content/Intent.html) data)\n\nGets the [GmsDocumentScanningResult](/android/reference/com/google/mlkit/vision/documentscanner/GmsDocumentScanningResult) from the scanning Activity result data.\n\nReturns `null` if fails to extract or construct the result. \n\n#### public abstract [List](//developer.android.com/reference/java/util/List.html)\\\u003c[GmsDocumentScanningResult.Page](/android/reference/com/google/mlkit/vision/documentscanner/GmsDocumentScanningResult.Page)\\\u003e\n**getPages** ()\n\nReturns the scanned pages or `null` if [GmsDocumentScannerOptions.RESULT_FORMAT_JPEG](/android/reference/com/google/mlkit/vision/documentscanner/GmsDocumentScannerOptions#RESULT_FORMAT_JPEG) was not specified when creating\nthe scanner options. \n\n#### public abstract [GmsDocumentScanningResult.Pdf](/android/reference/com/google/mlkit/vision/documentscanner/GmsDocumentScanningResult.Pdf) **getPdf** ()\n\nReturns the PDF result or `null` if [GmsDocumentScannerOptions.RESULT_FORMAT_PDF](/android/reference/com/google/mlkit/vision/documentscanner/GmsDocumentScannerOptions#RESULT_FORMAT_PDF) was not specified when creating\nthe scanner options."]]