SizeSearchCriteria
Inheritance: java.lang.Object, com.groupdocs.watermark.search.SearchCriteria
public class SizeSearchCriteria extends SearchCriteria
Represents criteria allowing filtering by watermark size.
Learn more:
The following example demonstrates how to find and remove watermarks using search criteria.
Watermarker watermarker = new Watermarker(“C:\test.some_ext”); SizeSearchCriteria widthRange = new SizeSearchCriteria(Dimension.Width, 50, 100); RotateAngleSearchCriteria rotateAngle = new RotateAngleSearchCriteria(0, 45); TextSearchCriteria textCriteria = new TextSearchCriteria(Pattern.compile("^Test watermark$"));
PossibleWatermarkCollection watermarks = watermarker.search(textCriteria.and(widthRange.or(rotateAngle))); watermarks.clear();
watermarker.save(“C:\modified_test.some_ext”); watermarker.close();
Constructors
Constructor | Description |
---|---|
SizeSearchCriteria(int dimension, double min, double max) | Initializes a new instance of the [SizeSearchCriteria](../../com.groupdocs.watermark.search/sizesearchcriteria) class with a specified dimension, a starting value and an ending value. |
Methods
Method | Description |
---|---|
getMinimum() | Gets the starting value. |
getMaximum() | Gets the ending value. |
getDimension() | Gets the dimension of watermark to search by. |
isSatisfiedBy(PossibleWatermark candidate) | |
accept(ICriteriaVisitor visitor) |
SizeSearchCriteria(int dimension, double min, double max)
public SizeSearchCriteria(int dimension, double min, double max)
Initializes a new instance of the [SizeSearchCriteria](../../com.groupdocs.watermark.search/sizesearchcriteria)
class with a specified dimension, a starting value and an ending value.
Parameters:
Parameter | Type | Description |
---|---|---|
dimension | int | The dimension [Dimension](../../com.groupdocs.watermark.common/dimension) of a watermark to search by. |
min | double | The starting value. |
max | double | The ending value. |
getMinimum()
public final double getMinimum()
Gets the starting value.
Returns: double - The starting value.
getMaximum()
public final double getMaximum()
Gets the ending value.
Returns: double - The ending value.
getDimension()
public final int getDimension()
Gets the dimension of watermark to search by.
Returns: int - The dimension of watermark to search by.
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 | ICriteriaVisitor |