VectorSearchCriteria class

VectorSearchCriteria class

Represents criteria allowing filtering by watermark color.

Learn more:

The VectorSearchCriteria type exposes the following members:

Constructors

Constructor Description
init Initializes a new VectorSearchCriteria instance.

Methods

Method Description
and_ Combines this SearchCriteria with other criteria using the logical AND operator. (inherited from SearchCriteria)
and_search_criteria (inherited from SearchCriteria)
not_ Negates this SearchCriteria. (inherited from SearchCriteria)
or_ Combines this SearchCriteria with other criteria using logical OR operator. (inherited from SearchCriteria)
or_search_criteria (inherited from SearchCriteria)

Properties

Property Description
vector_color_range The range of colors used to filter vector watermarks by foreground color.

Example

from groupdocs.watermark import Watermarker, VectorSearchCriteria, ColorRange, Color

# Open the document
watermarker = Watermarker(r"C:\test.pdf")

# Create search criteria
search_criteria = VectorSearchCriteria()

# Define the watermark color to filter by
watermark_color = Color.from_html("#a9aaae")

# Set the color range with brightness limits
criteria_vector_color_range = ColorRange(watermark_color)
criteria_vector_color_range.min_brightness = 0.1
criteria_vector_color_range.max_brightness = 0.7
search_criteria.vector_color_range = criteria_vector_color_range

# Search and remove watermarks
possible_watermark_collection = watermarker.search(search_criteria)
possible_watermark_collection.clear()

# Save the modified document
watermarker.save(r"C:\modified_test.pdf")

See Also