Reference documentation and code samples for the Cloud Vision V1 API class Google::Cloud::Vision::V1::TextAnnotation.
TextAnnotation contains a structured representation of OCR extracted text.
The hierarchy of an OCR extracted text structure is like this:
TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol
Each structural component, starting from Page, may further have their own
properties. Properties describe detected languages, breaks etc.. Please refer
to the
TextAnnotation.TextProperty
message definition below for more detail.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-09 UTC."],[],[],null,["# Cloud Vision V1 API - Class Google::Cloud::Vision::V1::TextAnnotation (v1.3.1)\n\nVersion latestkeyboard_arrow_down\n\n- [1.3.1 (latest)](/ruby/docs/reference/google-cloud-vision-v1/latest/Google-Cloud-Vision-V1-TextAnnotation)\n- [1.3.0](/ruby/docs/reference/google-cloud-vision-v1/1.3.0/Google-Cloud-Vision-V1-TextAnnotation)\n- [1.2.1](/ruby/docs/reference/google-cloud-vision-v1/1.2.1/Google-Cloud-Vision-V1-TextAnnotation)\n- [1.1.0](/ruby/docs/reference/google-cloud-vision-v1/1.1.0/Google-Cloud-Vision-V1-TextAnnotation)\n- [1.0.1](/ruby/docs/reference/google-cloud-vision-v1/1.0.1/Google-Cloud-Vision-V1-TextAnnotation)\n- [0.15.0](/ruby/docs/reference/google-cloud-vision-v1/0.15.0/Google-Cloud-Vision-V1-TextAnnotation)\n- [0.14.0](/ruby/docs/reference/google-cloud-vision-v1/0.14.0/Google-Cloud-Vision-V1-TextAnnotation)\n- [0.13.2](/ruby/docs/reference/google-cloud-vision-v1/0.13.2/Google-Cloud-Vision-V1-TextAnnotation)\n- [0.12.0](/ruby/docs/reference/google-cloud-vision-v1/0.12.0/Google-Cloud-Vision-V1-TextAnnotation)\n- [0.11.1](/ruby/docs/reference/google-cloud-vision-v1/0.11.1/Google-Cloud-Vision-V1-TextAnnotation)\n- [0.10.0](/ruby/docs/reference/google-cloud-vision-v1/0.10.0/Google-Cloud-Vision-V1-TextAnnotation)\n- [0.9.0](/ruby/docs/reference/google-cloud-vision-v1/0.9.0/Google-Cloud-Vision-V1-TextAnnotation)\n- [0.8.0](/ruby/docs/reference/google-cloud-vision-v1/0.8.0/Google-Cloud-Vision-V1-TextAnnotation)\n- [0.7.0](/ruby/docs/reference/google-cloud-vision-v1/0.7.0/Google-Cloud-Vision-V1-TextAnnotation)\n- [0.6.4](/ruby/docs/reference/google-cloud-vision-v1/0.6.4/Google-Cloud-Vision-V1-TextAnnotation) \nReference documentation and code samples for the Cloud Vision V1 API class Google::Cloud::Vision::V1::TextAnnotation.\n\nTextAnnotation contains a structured representation of OCR extracted text.\nThe hierarchy of an OCR extracted text structure is like this:\nTextAnnotation -\\\u003e Page -\\\u003e Block -\\\u003e Paragraph -\\\u003e Word -\\\u003e Symbol\nEach structural component, starting from Page, may further have their own\nproperties. Properties describe detected languages, breaks etc.. Please refer\nto the\n[TextAnnotation.TextProperty](/ruby/docs/reference/google-cloud-vision-v1/latest/Google-Cloud-Vision-V1-TextAnnotation-TextProperty \"Google::Cloud::Vision::V1::TextAnnotation::TextProperty (class)\")\nmessage definition below for more detail. \n\nInherits\n--------\n\n- Object \n\nExtended By\n-----------\n\n- Google::Protobuf::MessageExts::ClassMethods \n\nIncludes\n--------\n\n- Google::Protobuf::MessageExts\n\nMethods\n-------\n\n### #pages\n\n def pages() -\u003e ::Array\u003c::Google::Cloud::Vision::V1::Page\u003e\n\n**Returns**\n\n- (::Array\\\u003c[::Google::Cloud::Vision::V1::Page](./Google-Cloud-Vision-V1-Page)\\\u003e) --- List of pages detected by OCR.\n\n### #pages=\n\n def pages=(value) -\u003e ::Array\u003c::Google::Cloud::Vision::V1::Page\u003e\n\n**Parameter**\n\n- **value** (::Array\\\u003c[::Google::Cloud::Vision::V1::Page](./Google-Cloud-Vision-V1-Page)\\\u003e) --- List of pages detected by OCR. \n**Returns**\n\n- (::Array\\\u003c[::Google::Cloud::Vision::V1::Page](./Google-Cloud-Vision-V1-Page)\\\u003e) --- List of pages detected by OCR.\n\n### #text\n\n def text() -\u003e ::String\n\n**Returns**\n\n- (::String) --- UTF-8 text detected on the pages.\n\n### #text=\n\n def text=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- UTF-8 text detected on the pages. \n**Returns**\n\n- (::String) --- UTF-8 text detected on the pages."]]