Package com.google.cloud.spring.vision
Class DocumentOcrResultSet
java.lang.Object
com.google.cloud.spring.vision.DocumentOcrResultSet
Represents the parsed OCR content for an document in the provided range of pages.
-
Method Summary
Modifier and TypeMethodDescriptionReturns anIteratorover all the OCR pages of the document.intReturns the maximum page number in the result set.intReturns the minimum page number in the result set.getPage(int pageNumber) Retrieves the parsed OCR information of the page at indexpageNumberof the document.
-
Method Details
-
getMinPage
public int getMinPage()Returns the minimum page number in the result set.- Returns:
- the lowest page number in the result set.
-
getMaxPage
public int getMaxPage()Returns the maximum page number in the result set.- Returns:
- the highest page number in the result set.
-
getPage
public TextAnnotation getPage(int pageNumber) throws com.google.protobuf.InvalidProtocolBufferException Retrieves the parsed OCR information of the page at indexpageNumberof the document. The page number must be a value betweengetMinPage()andgetMaxPage().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
- Parameters:
pageNumber- the page number of the document- Returns:
- the
TextAnnotationrepresenting the page of the document - Throws:
com.google.protobuf.InvalidProtocolBufferException- if the OCR information for the page failed to be parsed
-
getAllPages
Returns anIteratorover all the OCR pages of the document.- Returns:
- iterator of
TextAnnotationdescribing OCR content of each page in the document.
-