(static) getBoundingRectangle Get the rectangle of a search result to be used for locating a search result on a page.(options) → {Rectangle}
Parameters:
Name
Type
Description
options
object
An object containing options for this method.
Properties
Name
Type
Description
rectangles
array
Rectangles received via the Text RESTful API.
startIndex
integer
The index of the start of the search result.
endIndex
integer
The index of the end of the search result.
Returns:
The rectangle surrounding the search result.
Type
Rectangle
(static) getContext Get the context of a search result for display in a search panel or something similar.(options) → {SearchContext}
Parameters:
Name
Type
Description
options
object
An object containing options for this method.
Properties
Name
Type
Description
text
string
A string of text to provide context with.
startIndex
integer
The index of the start of the search result.
endIndex
integer
The index of the end of the search result.
padding
integer
The number of characters to display on either side of the search result.
Returns:
The search result with context.
Type
SearchContext
(static) getLineRectangles Get the line rectangles of a search result to be used for highlighing or otherwise annotating a search result on a page.(options) → {Array.<Rectangle>}
Parameters:
Name
Type
Description
options
object
An object containing options for this method.
Properties
Name
Type
Description
rectangles
array
Rectangles received via the Text RESTful API.
startIndex
integer
The index of the start of the search result.
endIndex
integer
The index of the end of the search result.
Returns:
The rectangles surrounding each line of text of the search result.