ImageGear .NET v25.2 - Updated
IPCCSearch-Formatter
API Reference > ViewerControl API > IPCCSearch-Formatter

Namespace: Formatter

IPCCSearch~Formatter

ImageGear.Web Search Formatter

Methods

(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.
Type
Array.<Rectangle>

Type Definitions

Rectangle

Type:
  • Object
Properties:
Name Type Description
x number The position of the left side of a rectangle.
y number The position of the top side of a rectangle.
width number The width of a rectangle.
height number The height of a rectangle.

SearchContext

Type:
  • Object
Properties:
Name Type Description
startIndex integer The index of the search term in the context.
context string The context of the search result.

Is this page helpful?
Yes No
Thanks for your feedback.