TextFormattingSearchCriteria class
Leave feedback
On this page
Represents criteria allowing filtering by text formatting.
Learn more:
- Searching watermarks (https://docs.groupdocs.com/display/watermarknet/Searching+watermarks)
The TextFormattingSearchCriteria type exposes the following members:
| Constructor | Description |
|---|---|
| init | Initializes a new instance of TextFormattingSearchCriteria. |
| 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 the logical OR operator. (inherited from SearchCriteria) |
| or_search_criteria | (inherited from SearchCriteria) |
| Property | Description |
|---|---|
| background_color_range | The range of colors which are used to filter watermarks by text background color. |
| font_bold | The font used in watermark text formatting is bold. |
| font_italic | The font_italic property indicates whether the watermark text font is italic. |
| font_name | The name of the font used in possible watermark text formatting. |
| font_strikeout | The font strikeout flag for the watermark text formatting. |
| font_underline | The font underline flag indicating whether the watermark text uses an underline. |
| foreground_color_range | The range of colors used to filter watermarks by text foreground color. |
| max_font_size | The ending value of the font size. |
| min_font_size | The starting value of the font size. |
from groupdocs.watermark import Watermarker
from groupdocs.watermark.search.search_criteria import TextFormattingSearchCriteria, ColorRange
def search_by_formatting():
with Watermarker("./document.pdf") as watermarker:
criteria = TextFormattingSearchCriteria()
criteria.foreground_color_range = ColorRange()
criteria.foreground_color_range.min_hue = -15
criteria.foreground_color_range.max_hue = 15
criteria.foreground_color_range.min_brightness = 0.01
criteria.foreground_color_range.max_brightness = 0.99
criteria.min_font_size = 19
criteria.max_font_size = 42
possible = watermarker.search(criteria)
print("Found", len(possible), "possible watermark(s)")
if __name__ == "__main__":
search_by_formatting()
Task guides that use TextFormattingSearchCriteria:
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.