TextFormattingSearchCriteria

Inheritance: java.lang.Object, com.groupdocs.watermark.search.SearchCriteria

public class TextFormattingSearchCriteria extends SearchCriteria

Represents criteria allowing filtering by text formatting.

Learn more:

The following example demonstrates how to remove possible watermarks with a particular text formatting (regardless of document type).

Watermarker watermarker = new Watermarker(“D:\test.doc”); TextFormattingSearchCriteria criteria = new TextFormattingSearchCriteria();

criteria.setForegroundColorRange(new ColorRange()); criteria.getForegroundColorRange().setMinHue(-5); criteria.getForegroundColorRange().setMaxHue(10); criteria.getForegroundColorRange().setMinBrightness(0.01f); criteria.getForegroundColorRange().setMaxBrightness(0.99f); criteria.setBackgroundColorRange(new ColorRange()); criteria.getBackgroundColorRange().setEmpty(true); criteria.setFontName(“Arial”); criteria.setMinFontSize(19); criteria.setMaxFontSize(42); criteria.setFontBold(true);

PossibleWatermarkCollection watermarks = watermarker.search(criteria); watermarks.clear();

watermarker.save(“C:\modified_test.some_ext”); watermarker.close();

Constructors

Constructor Description
TextFormattingSearchCriteria() Initializes a new instance of the [TextFormattingSearchCriteria](../../com.groupdocs.watermark.search/textformattingsearchcriteria) class.

Methods

Method Description
getForegroundColorRange() Gets the range of colors which are used to filter watermarks by text foreground color.
setForegroundColorRange(ColorRange value) Sets the range of colors which are used to filter watermarks by text foreground color.
getBackgroundColorRange() Gets the range of colors which are used to filter watermarks by text background color.
setBackgroundColorRange(ColorRange value) Sets the range of colors which are used to filter watermarks by text background color.
getFontName() Gets the name of the font which is used in possible watermark text formatting.
setFontName(String value) Sets the name of the font which is used in possible watermark text formatting.
getMinFontSize() Gets the starting value of the font size.
setMinFontSize(float value) Sets the starting value of the font size.
getMaxFontSize() Gets the ending value of the font size.
setMaxFontSize(float value) Sets the ending value of the font size.
getFontBold() Gets a value indicating whether the font used in watermark text formatting is bold.
setFontBold(Boolean value) Sets a value indicating whether the font used in watermark text formatting is bold.
getFontItalic() Gets a value indicating whether the font used in watermark text formatting is italic.
setFontItalic(Boolean value) Sets a value indicating whether the font used in watermark text formatting is italic.
getFontUnderline() Gets a value indicating whether the font used in watermark text formatting is underline.
setFontUnderline(Boolean value) Sets a value indicating whether the font used in watermark text formatting is underline.
getFontStrikeout() Gets a value indicating whether the font used in watermark text formatting is strikeout.
setFontStrikeout(Boolean value) Sets a value indicating whether the font used in watermark text formatting is strikeout.
isSatisfiedBy(PossibleWatermark candidate)
accept(ICriteriaVisitor visitor)

TextFormattingSearchCriteria()

public TextFormattingSearchCriteria()

Initializes a new instance of the [TextFormattingSearchCriteria](../../com.groupdocs.watermark.search/textformattingsearchcriteria) class.

getForegroundColorRange()

public final ColorRange getForegroundColorRange()

Gets the range of colors which are used to filter watermarks by text foreground color.

Returns: ColorRange - The range of colors which are used to filter watermarks by text foreground color.

setForegroundColorRange(ColorRange value)

public final void setForegroundColorRange(ColorRange value)

Sets the range of colors which are used to filter watermarks by text foreground color.

Parameters:

Parameter Type Description
value ColorRange The range of colors which are used to filter watermarks by text foreground color.

getBackgroundColorRange()

public final ColorRange getBackgroundColorRange()

Gets the range of colors which are used to filter watermarks by text background color.

Returns: ColorRange - The range of colors which are used to filter watermarks by text background color.

setBackgroundColorRange(ColorRange value)

public final void setBackgroundColorRange(ColorRange value)

Sets the range of colors which are used to filter watermarks by text background color.

Parameters:

Parameter Type Description
value ColorRange The range of colors which are used to filter watermarks by text background color.

getFontName()

public final String getFontName()

Gets the name of the font which is used in possible watermark text formatting.

Returns: java.lang.String - The default value is null, which means that the filter is not applied.

setFontName(String value)

public final void setFontName(String value)

Sets the name of the font which is used in possible watermark text formatting.

Parameters:

Parameter Type Description
value java.lang.String The default value is null, which means that the filter is not applied.

getMinFontSize()

public final float getMinFontSize()

Gets the starting value of the font size.

Returns: float - The starting value of the font size.

setMinFontSize(float value)

public final void setMinFontSize(float value)

Sets the starting value of the font size.

Parameters:

Parameter Type Description
value float The starting value of the font size.

getMaxFontSize()

public final float getMaxFontSize()

Gets the ending value of the font size.

Returns: float - The ending value of the font size.

setMaxFontSize(float value)

public final void setMaxFontSize(float value)

Sets the ending value of the font size.

Parameters:

Parameter Type Description
value float The ending value of the font size.

getFontBold()

public final Boolean getFontBold()

Gets a value indicating whether the font used in watermark text formatting is bold.

Returns: java.lang.Boolean - The default value is null, which means that the filter is not applied.

setFontBold(Boolean value)

public final void setFontBold(Boolean value)

Sets a value indicating whether the font used in watermark text formatting is bold.

Parameters:

Parameter Type Description
value java.lang.Boolean The default value is null, which means that the filter is not applied.

getFontItalic()

public final Boolean getFontItalic()

Gets a value indicating whether the font used in watermark text formatting is italic.

Returns: java.lang.Boolean - The default value is null, which means that the filter is not applied.

setFontItalic(Boolean value)

public final void setFontItalic(Boolean value)

Sets a value indicating whether the font used in watermark text formatting is italic.

Parameters:

Parameter Type Description
value java.lang.Boolean The default value is null, which means that the filter is not applied.

getFontUnderline()

public final Boolean getFontUnderline()

Gets a value indicating whether the font used in watermark text formatting is underline.

Returns: java.lang.Boolean - The default value is null, which means that the filter is not applied.

setFontUnderline(Boolean value)

public final void setFontUnderline(Boolean value)

Sets a value indicating whether the font used in watermark text formatting is underline.

Parameters:

Parameter Type Description
value java.lang.Boolean The default value is null, which means that the filter is not applied.

getFontStrikeout()

public final Boolean getFontStrikeout()

Gets a value indicating whether the font used in watermark text formatting is strikeout.

Returns: java.lang.Boolean - The default value is null, which means that the filter is not applied.

setFontStrikeout(Boolean value)

public final void setFontStrikeout(Boolean value)

Sets a value indicating whether the font used in watermark text formatting is strikeout.

Parameters:

Parameter Type Description
value java.lang.Boolean The default value is null, which means that the filter is not applied.

isSatisfiedBy(PossibleWatermark candidate)

public boolean isSatisfiedBy(PossibleWatermark candidate)

Parameters:

Parameter Type Description
candidate PossibleWatermark

Returns: boolean

accept(ICriteriaVisitor visitor)

public void accept(ICriteriaVisitor visitor)

Parameters:

Parameter Type Description
visitor com.groupdocs.watermark.internal.ICriteriaVisitor