public class DocumentOcrResultSet extends Object
Modifier and Type | Method and Description |
---|---|
Iterator<TextAnnotation> |
getAllPages()
Returns an
Iterator over all the OCR pages of the document. |
int |
getMaxPage()
Returns the maximum page number in the result set.
|
int |
getMinPage()
Returns the minimum page number in the result set.
|
TextAnnotation |
getPage(int pageNumber)
Retrieves the parsed OCR information of the page at index
pageNumber of the
document. |
public int getMinPage()
public int getMaxPage()
public TextAnnotation getPage(int pageNumber) throws com.google.protobuf.InvalidProtocolBufferException
pageNumber
of the
document. The page number must be a value between getMinPage()
and getMaxPage()
.
This returns a TextAnnotation object which is Google Cloud Vision's representation of a page of a document. For more information on reading this object, see: https://cloud.google.com/vision/docs/reference/rpc/google.cloud.vision.v1#google.cloud.vision.v1.TextAnnotation
pageNumber
- the page number of the documentTextAnnotation
representing the page of the documentcom.google.protobuf.InvalidProtocolBufferException
- if the OCR information for the page failed to be
parsedpublic Iterator<TextAnnotation> getAllPages()
Iterator
over all the OCR pages of the document.TextAnnotation
describing OCR content of each page in the
document.Copyright © 2021. All rights reserved.