com.groupdocs.watermark.search

Interfaces

Classes

com.groupdocs.watermark.search

Class TextSearchCriteria



  • public class TextSearchCriteria
    extends SearchCriteria
    Represents criteria allowing filtering by watermark text.

    Learn more:

    The following example demonstrates how to find and remove watermark 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();
     
    • Constructor Detail

      • TextSearchCriteria

        public TextSearchCriteria(Pattern pattern)
        Initializes a new instance of the TextSearchCriteria class with a specified regular expression.
        Parameters:
        pattern - The regular expression to match.
      • TextSearchCriteria

        public TextSearchCriteria(String searchString,
                          boolean isMatchCase)
        Initializes a new instance of the TextSearchCriteria class with a search string and a flag for comparison.
        Parameters:
        searchString - The exact string to search for.
        isMatchCase - false to ignore case during the comparison; otherwise, true.
      • TextSearchCriteria

        public TextSearchCriteria(String searchString)
        Initializes a new instance of the TextSearchCriteria class with a search string.
        Parameters:
        searchString - The exact string to search for.
    • Method Detail

      • getPattern

        public final Pattern getPattern()

        Gets the search pattern.

        Returns:
        The regular expression pattern to match.
      • getSkipUnreadableCharacters

        public final boolean getSkipUnreadableCharacters()

        Gets a value indicating that unreadable characters will be skipped during string comparison.

        Returns:
        A value indicating that unreadable characters will be skipped during string comparison.
      • setSkipUnreadableCharacters

        public final void setSkipUnreadableCharacters(boolean value)

        Sets a value indicating that unreadable characters will be skipped during string comparison.

        Parameters:
        value - A value indicating that unreadable characters will be skipped during string comparison.