Zum Hauptinhalt springen
Dieses Objekt repräsentiert erkannten Text. Der erkannte Text ist eine Sammlung von Absätzen. Der Zugriff auf diese Sammlung erfolgt über die Eigenschaft Paragraphs. Darüber hinaus stellt dieses Objekt Eigenschaften für den Zugriff auf verschiedene Textattribute sowie Methoden bereit, mit denen sich Operationen wie vertikales und horizontales Aufteilen, das Entfernen von Bereichen usw. ausführen lassen. Das Text-Objekt kann entweder eigenständig vorkommen oder ein Unterobjekt eines anderen Objekts sein, das eine Layouteinheit repräsentiert (Textblock, Tabellenzelle usw.). Eine Position im Text wird durch das „Koordinatenpaar“ (Absatz;Symbol) definiert. Es gibt auch die sogenannte „spezielle Position“, für die paragraph=<die Anzahl der Absätze>, symbol=0 gilt.
Dieses Objekt ist über einen erkannten Block mit Text verfügbar. Sie können auch über das Objekt PlainText auf den vollständig erkannten Text des Dokuments oder der Seite in einem speziellen „Nur-Text“-Format zugreifen.

Eigenschaften

,read-only

Returns the Engine object.

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.

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

,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 theobjects 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.

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

Diese Eigenschaft ist nur nach der Erkennung aussagekräftig, die Orientierung eines bereits erkannten Textes kann jedoch nicht mehr geändert werden. Wenn Sie die Seitenorientierung vor der Erkennung festlegen möchten, verwenden Sie die-Eigenschaft des ImageProcessingParams-Objekts. Um die Textorientierung in einem bestimmten Textblock festzulegen, setzen Sie die-Eigenschaft vor der Erkennung.

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 themethod, 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 theproperty. Otherwise the property is read-only.
  • The TextOrientation object which hasproperty equal to RT_UnknownRotation orproperty equal to TRT_Unknown cannot be assigned to this property.

Methoden

NameBeschreibung
AppendEmptyParagraphFügt am Ende des aktuellen Texts einen leeren Absatz an.
GetRangeGibt eine Kopie des Textbereichs zurück.
RemoveEntfernt einen Bereich aus dem aktuellen Text.
RemoveAllEntfernt alle Absätze aus dem aktuellen Text.
Text Objektdiagramm

Eingabeparameter

Dieses Objekt ist der Eingabeparameter der InsertText-Methode des Paragraph-Objekts.

Beispiele

FREngine.IBlock block;
int suspiciousCharsCount = 0;
// Durchläuft die Absätze eines Textblocks und liest den Text aus
FREngine.ITextBlock textBlock = block.GetAsTextBlock();
int paragraphsCount = textBlock.Text.Paragraphs.Count;
for (int iPar = 0; iPar < paragraphsCount; iPar++)
{
 FREngine.IParagraph par = textBlock.Text.Paragraphs[iPar];
 string text = par.Text;
 // etwas mit dem Text machen
}
Das Objekt wird in den folgenden Codebeispielen verwendet:

Siehe auch

Arbeiten mit Text Arbeiten mit Eigenschaften