TextSearchOptions

Inheritance: java.lang.Object, com.aspose.pdf.TextOptions

public final class TextSearchOptions extends TextOptions

Represents text search options

Constructors

ConstructorDescription
TextSearchOptions(boolean isRegularExpressionUsed)Initializes new instance of the TextSearchOptions object.
TextSearchOptions(Rectangle rectangle)Initializes new instance of the TextSearchOptions object.
TextSearchOptions(Rectangle rectangle, boolean isRegularExpressionUsed)Initializes new instance of the TextSearchOptions object.

Methods

MethodDescription
setDotallMode(boolean dotallMode)Enables dotall mode.
isDotallMode()In dotall mode, the expression . matches any character, including a line terminator.
isRegularExpressionUsed()Indicated that regular expression is used or not
setRegularExpressionUsed(boolean value)Indicated that regular expression is used or not
getLimitToPageBounds()Gets indication that text is searched within the page bounds.
setLimitToPageBounds(boolean value)Sets indication that text is searched within the page bounds.
getRectangle()Gets rectangle that bounds the searched text.
setRectangle(Rectangle value)Sets rectangle that bounds the searched text.
getUseFontEngineEncoding()Gets indication that text will be searched using font engine encoding.
setUseFontEngineEncoding(boolean value)Sets indication that text will be searched using font engine encoding.
isIgnoreShadowText()Gets or sets indication that text fragments representing shadow of normal text will be ignored during search.
setIgnoreShadowText(boolean value)Gets or sets indication that text fragments representing shadow of normal text will be ignored during search.
getLogTextExtractionErrors()Gets or sets indication that text extraction (decoding) errors will be logged in the text (fragment) absorber.
setLogTextExtractionErrors(boolean value)Gets or sets indication that text extraction (decoding) errors will be logged in the text (fragment) absorber.
getIgnoreResourceFontErrors()Gets or sets indication that errors related to absence of font will be ignored by text (fragment) absorber.
setIgnoreResourceFontErrors(boolean value)Gets or sets indication that errors related to absence of font will be ignored by text (fragment) absorber.
getSearchForTextRelatedGraphics()Gets or sets value that permits searching for text related graphics (underlining, background etc.) during text search.
setSearchForTextRelatedGraphics(boolean value)Gets or sets value that permits searching for text related graphics (underlining, background etc.) during text search.
getStoredGraphicElementsMaxCount()Gets value that limits searching for text related graphics (underlining, background etc.) on a page for the speciefied number of elements.
setStoredGraphicElementsMaxCount(int value)Sets value that limits searching for text related graphics (underlining, background etc.) on a page for the speciefied number of elements.
isSearchInAnnotations()Gets or sets value that permits searching for text in Annotations.
setSearchInAnnotations(boolean value)Gets or sets value that permits searching for text in Annotations.

TextSearchOptions(boolean isRegularExpressionUsed)

public TextSearchOptions(boolean isRegularExpressionUsed)

Initializes new instance of the TextSearchOptions object. Specifies regular expression usage mode.

Parameters:

ParameterTypeDescription
isRegularExpressionUsedbooleanValue that indicates that regularexpression is used.

TextSearchOptions(Rectangle rectangle)

public TextSearchOptions(Rectangle rectangle)

Initializes new instance of the TextSearchOptions object. Specifies rectangle that delimits the searched text.

Parameters:

ParameterTypeDescription
rectangleRectangleRectangle that includes the extracted text.

TextSearchOptions(Rectangle rectangle, boolean isRegularExpressionUsed)

public TextSearchOptions(Rectangle rectangle, boolean isRegularExpressionUsed)

Initializes new instance of the TextSearchOptions object. Specifies rectangle that delimits the searched text and regular expression usage mode.

Parameters:

ParameterTypeDescription
rectangleRectangleRectangle that includes the extracted text.
isRegularExpressionUsedbooleanValue that indicates that regular expression is used.

setDotallMode(boolean dotallMode)

public static void setDotallMode(boolean dotallMode)

Enables dotall mode.

In dotall mode, the expression . matches any character, including a line terminator. By default this expression does not match line terminators.

Parameters:

ParameterTypeDescription
dotallModebooleanboolean value

isDotallMode()

public static boolean isDotallMode()

In dotall mode, the expression . matches any character, including a line terminator. By default this expression does not match line terminators.

Returns: boolean - boolean value

isRegularExpressionUsed()

public boolean isRegularExpressionUsed()

Indicated that regular expression is used or not

Returns: boolean - boolean value

setRegularExpressionUsed(boolean value)

public void setRegularExpressionUsed(boolean value)

Indicated that regular expression is used or not

Parameters:

ParameterTypeDescription
valuebooleanboolean value

getLimitToPageBounds()

public boolean getLimitToPageBounds()

Gets indication that text is searched within the page bounds.

Returns: boolean - boolean value

setLimitToPageBounds(boolean value)

public void setLimitToPageBounds(boolean value)

Sets indication that text is searched within the page bounds.

Parameters:

ParameterTypeDescription
valuebooleanboolean value

getRectangle()

public Rectangle getRectangle()

Gets rectangle that bounds the searched text. The property may be used in case it is required to delimit text extraction or text replace region.

Returns: Rectangle - Rectangle value

setRectangle(Rectangle value)

public void setRectangle(Rectangle value)

Sets rectangle that bounds the searched text. The property may be used in case it is required to delimit text extraction or text replace region.

Parameters:

ParameterTypeDescription
valueRectangleRectangle object

getUseFontEngineEncoding()

public boolean getUseFontEngineEncoding()

Gets indication that text will be searched using font engine encoding. true - means that font engine encoding will be used (try this if text search fails because of imperfect encoding in the document) false - means that document font encoding will be used (default value)

Returns: boolean - boolean value

setUseFontEngineEncoding(boolean value)

public void setUseFontEngineEncoding(boolean value)

Sets indication that text will be searched using font engine encoding. true - means that font engine encoding will be used (try this if text search fails because of imperfect encoding in the document) false - means that document font encoding will be used (default value)

Parameters:

ParameterTypeDescription
valuebooleanboolean value

isIgnoreShadowText()

public boolean isIgnoreShadowText()

Gets or sets indication that text fragments representing shadow of normal text will be ignored during search. true - means that shadow text will not be found (try this if text search returns duplicated fragments on the close positions) false - means that shadow text will be found as well as normal text (default value)

Returns: boolean - boolean value

setIgnoreShadowText(boolean value)

public void setIgnoreShadowText(boolean value)

Gets or sets indication that text fragments representing shadow of normal text will be ignored during search. true - means that shadow text will not be found (try this if text search returns duplicated fragments on the close positions) false - means that shadow text will be found as well as normal text (default value)

Parameters:

ParameterTypeDescription
valuebooleanboolean value

getLogTextExtractionErrors()

public boolean getLogTextExtractionErrors()

Gets or sets indication that text extraction (decoding) errors will be logged in the text (fragment) absorber. true - means that text extraction (decoding) errors will be loged. It may decrease performance. false (default) - no error loging.

Returns: boolean - boolean value

setLogTextExtractionErrors(boolean value)

public void setLogTextExtractionErrors(boolean value)

Gets or sets indication that text extraction (decoding) errors will be logged in the text (fragment) absorber. true - means that text extraction (decoding) errors will be loged. It may decrease performance. false (default) - no error loging.

Parameters:

ParameterTypeDescription
valuebooleanboolean value

getIgnoreResourceFontErrors()

public final boolean getIgnoreResourceFontErrors()

Gets or sets indication that errors related to absence of font will be ignored by text (fragment) absorber. true - means that errors of absence of font will be ignored. Text segments that refer to incorrect resources will be skipped during processing. false (default) - absence of font error will terminate processing by throwing exception.

Returns: boolean - boolean value

setIgnoreResourceFontErrors(boolean value)

public final void setIgnoreResourceFontErrors(boolean value)

Gets or sets indication that errors related to absence of font will be ignored by text (fragment) absorber. true - means that errors of absence of font will be ignored. Text segments that refer to incorrect resources will be skipped during processing. false (default) - absence of font error will terminate processing by throwing exception.

Parameters:

ParameterTypeDescription
valuebooleanboolean value

getSearchForTextRelatedGraphics()

public final boolean getSearchForTextRelatedGraphics()

Gets or sets value that permits searching for text related graphics (underlining, background etc.) during text search. true - searching for text related graphics will be performed (default value). false - graphic elements that may present in source document will be ignored. Set this in case of performance issues or no need to handle underlining, background, or clipping.

Returns: boolean - boolean value

setSearchForTextRelatedGraphics(boolean value)

public final void setSearchForTextRelatedGraphics(boolean value)

Gets or sets value that permits searching for text related graphics (underlining, background etc.) during text search. true - searching for text related graphics will be performed (default value). false - graphic elements that may present in source document will be ignored. Set this in case of performance issues or no need to handle underlining, background, or clipping.

Parameters:

ParameterTypeDescription
valuebooleanboolean value

getStoredGraphicElementsMaxCount()

public final int getStoredGraphicElementsMaxCount()

Gets value that limits searching for text related graphics (underlining, background etc.) on a page for the speciefied number of elements. The default is 250. Set lesser value in the case of performance problems, try larger value in the case some graphic elements wasn’t found.

Returns: int - int value

setStoredGraphicElementsMaxCount(int value)

public final void setStoredGraphicElementsMaxCount(int value)

Sets value that limits searching for text related graphics (underlining, background etc.) on a page for the speciefied number of elements. The default is 250. Set lesser value in the case of performance problems, try larger value in the case some graphic elements wasn’t found.

Parameters:

ParameterTypeDescription
valueintint value

isSearchInAnnotations()

public final boolean isSearchInAnnotations()

Gets or sets value that permits searching for text in Annotations. true - text will be searched in Annotations. false - text in Annotations won’t be parsed by TextFragmentAbsorber.

Returns: boolean - boolean value

setSearchInAnnotations(boolean value)

public final void setSearchInAnnotations(boolean value)

Gets or sets value that permits searching for text in Annotations. true - text will be searched in Annotations. false - text in Annotations won’t be parsed by TextFragmentAbsorber.

Parameters:

ParameterTypeDescription
valuebooleanboolean value