pdfOCR 3.0.2 API
iText.Pdfocr.TextInfo Class Reference

This class describes how recognized text is positioned on the image providing bbox for each text item (could be a line or a word). More...

Public Member Functions

  TextInfo ()
  Creates a new TextInfo instance. More...
 
  TextInfo (iText.Pdfocr.TextInfo textInfo)
  Creates a new TextInfo instance from existing one. More...
 
  TextInfo (String text, Rectangle bbox)
  Creates a new TextInfo instance. More...
 
virtual String  GetText ()
  Gets text element. More...
 
virtual void  SetText (String newText)
  Sets text element. More...
 
virtual Rectangle  GetBboxRect ()
  Gets bbox coordinates. More...
 
virtual void  SetBboxRect (Rectangle bbox)
  Sets text bbox. More...
 
virtual LogicalStructureTreeItem  GetLogicalStructureTreeItem ()
  Retrieves structure tree item for the text item. More...
 
virtual void  SetLogicalStructureTreeItem (LogicalStructureTreeItem logicalStructureTreeItem)
  Sets logical structure tree parent item for the text info. More...
 

Detailed Description

This class describes how recognized text is positioned on the image providing bbox for each text item (could be a line or a word).

Constructor & Destructor Documentation

◆ TextInfo() [1/3]

iText.Pdfocr.TextInfo.TextInfo ( )
inline

Creates a new TextInfo instance.

◆ TextInfo() [2/3]

iText.Pdfocr.TextInfo.TextInfo ( iText.Pdfocr.TextInfo  textInfo )
inline

Creates a new TextInfo instance from existing one.

Parameters
textInfo to create from

◆ TextInfo() [3/3]

iText.Pdfocr.TextInfo.TextInfo ( String  text,
Rectangle  bbox 
)
inline

Creates a new TextInfo instance.

Parameters
text any text
bbox

iText.Kernel.Geom.Rectangle describing text bbox

Member Function Documentation

◆ GetBboxRect()

virtual Rectangle iText.Pdfocr.TextInfo.GetBboxRect ( )
inlinevirtual

Gets bbox coordinates.

Returns

iText.Kernel.Geom.Rectangle describing text bbox

◆ GetLogicalStructureTreeItem()

virtual LogicalStructureTreeItem iText.Pdfocr.TextInfo.GetLogicalStructureTreeItem ( )
inlinevirtual

Retrieves structure tree item for the text item.

Returns
structure tree item.

◆ GetText()

virtual String iText.Pdfocr.TextInfo.GetText ( )
inlinevirtual

Gets text element.

Returns
String

◆ SetBboxRect()

virtual void iText.Pdfocr.TextInfo.SetBboxRect ( Rectangle  bbox )
inlinevirtual

Sets text bbox.

Parameters
bbox

iText.Kernel.Geom.Rectangle describing text bbox

◆ SetLogicalStructureTreeItem()

virtual void iText.Pdfocr.TextInfo.SetLogicalStructureTreeItem ( LogicalStructureTreeItem  logicalStructureTreeItem )
inlinevirtual

Sets logical structure tree parent item for the text info.

Sets logical structure tree parent item for the text info. It allows to organize text chunks into logical hierarchy, e.g. specify document paragraphs, tables, etc.

If LogicalStructureTreeItem is set, then the list of TextInfo s in IOcrEngine.DoImageOcr(System.IO.FileInfo) return value is expected to be in logical order.

Parameters
logicalStructureTreeItem structure tree item.

◆ SetText()

virtual void iText.Pdfocr.TextInfo.SetText ( String  newText )
inlinevirtual

Sets text element.

Parameters
newText retrieved text