ParserGetHighlight Method |
Extracts a highlight from the document.
Namespace: GroupDocs.ParserAssembly: GroupDocs.Parser (in GroupDocs.Parser.dll) Version: 21.2.0
Syntaxpublic HighlightItem GetHighlight(
int position,
bool isDirect,
HighlightOptions options
)
Public Function GetHighlight (
position As Integer,
isDirect As Boolean,
options As HighlightOptions
) As HighlightItem
public:
HighlightItem^ GetHighlight(
int position,
bool isDirect,
HighlightOptions^ options
)
member GetHighlight :
position : int *
isDirect : bool *
options : HighlightOptions -> HighlightItem
Parameters
- position
- Type: SystemInt32
The start position of the highlight. - isDirect
- Type: SystemBoolean
The value that indicates whether highlight extraction is direct.
true if the higlight is extracted by the right of position; otherwise, false.
- options
- Type: GroupDocs.Parser.OptionsHighlightOptions
The highlight extraction options.
Return Value
Type:
HighlightItem
An instance of
HighlightItem class that represents the extracted highlight;
null if highlight extraction isn't supported.
Remarks
ExamplesThe following example shows how to extract a highlight that contains 3 words:
using (Parser parser = new Parser(filePath))
{
HighlightItem hl = parser.GetHighlight(2, true, new HighlightOptions(3));
if (hl == null)
{
Console.WriteLine("Highlight extraction isn't supported");
return;
}
Console.WriteLine(string.Format("At {0}: {1}", hl.Position, hl.Text));
}
See Also