Chinese Simplified (简体中文)

Text Object (IText Interface)

This object represents recognized text. The recognized text is a collection of paragraphs. Access to this collection is provided through the Paragraphs property. Besides, this object exposes properties for accessing different text attributes and methods allowing operations upon it, such as vertical and horizontal splitting, range removal etc. The Text object may exist either independently or be a subobject of some other object representing a unit of layout (text block, table cell etc.). A position in text is defined by the "coordinate pair" (paragraph;symbol). There is also the so-called "special position," for which paragraph=<the number of paragraphs>, symbol=0.

Note: This object is available via a recognized block with text. You can also access the full recognized text of the document or page in a special "plain text" format via the PlainText object.

Properties

Name Type Description
Application Engine, read-only Returns the Engine object.
IsInverted VARIANT_BOOL

Specifies if the colors of the whole text are inverted. This attribute is set to TRUE if the recognized text belongs to a block or table cell that also has the inverted attribute. It may be used in user interface to display the text with white font against the black background.

Note: You can edit this property only if the Text object was received via the ITextBlock::Text property. Otherwise, the property is read-only.

Paragraphs Paragraphs, read-only Provides access to the collection of paragraphs of the Text object. Every Text object, even an empty one, contains a valid subobject of the Paragraphs type. This object is a collection of the Paragraph objects and may not contain any elements. The Paragraph object represents a paragraph in the recognized text. It is through this object that the content of the recognized text may be obtained.
TextOrientation TextOrientation

Stores the orientation of the text. It is used internally by the ABBYY FineReader Engine when exporting the recognized text.

This property is meaningful only after recognition but you cannot change the orientation of the text that has already been recognized. If you want to specify the page orientation before recognition, use the RotationType property of the ImageProcessingParams object. To specify the text orientation in a particular text block, set the ITextBlock::TextOrientation property before recognition.

The only scenario in which you need to set the value of this property is when you wish to insert some additional text which must appear in the exported file. After adding that text, specify its orientation with the help of this property and call some method which performs synthesis before exporting the document.

Notes:

  • The property returns a constant object. To change the text orientation, you must at first obtain an intermediate TextOrientation object using the IEngine::CreateTextOrientation method, change the necessary parameters, and then assign the obtained object to the property.
  • You can edit this property only if the Text object was received via the ITextBlock::Text property. Otherwise the property is read-only.
  • The TextOrientation object which has RotationType property equal to RT_UnknownRotation or ReadingType property equal to TRT_Unknown cannot be assigned to this property.

Methods

Name Description
AppendEmptyParagraph Appends empty paragraph to the end of the current text.
GetRange Returns a copy of the range of text.
Remove Removes a range from the current text.
RemoveAll Removes all paragraphs from the current text.

Related objects

Object Diagram

Input parameter

This object is the input parameter of the InsertText method of the Paragraph object.

Samples

C# code

The object is used in the following code samples: CustomLanguage, RecognizedTextProcessing; and demo tools: Camera OCR, Engine Predefined Processing Profiles, Image Preprocessing.

See also

Working with Text

Working with Properties

9/17/2024 3:14:41 PM

Usage of Cookies. In order to optimize the website functionality and improve your online experience ABBYY uses cookies. You agree to the usage of cookies when you continue using this site. Further details can be found in our Privacy Notice.