The following example demonstrates how to search for images in the attached files (pdf).
WatermarkerSettings settings = new WatermarkerSettings();
settings.setSearchableObjects(new SearchableObjects());
settings.getSearchableObjects().setPdfSearchableObjects(PdfSearchableObjects.All);
PdfLoadOptions loadOptions = new PdfLoadOptions();
Watermarker watermarker = new Watermarker(“D:\test.pdf”, loadOptions);
// Specify sample image to compare document images with
ImageSearchCriteria criteria = new ImageDctHashSearchCriteria(“D:\sample.png”);
// Search for similar images
PossibleWatermarkCollection possibleWatermarks = watermarker.search(criteria);
// Remove or modify found image watermarks
// …
Initializes a new instance of the [ImageDctHashSearchCriteria](../../com.groupdocs.watermark.search/imagedcthashsearchcriteria) class with a specified file path.
Initializes a new instance of the [ImageDctHashSearchCriteria](../../com.groupdocs.watermark.search/imagedcthashsearchcriteria) class with a specified stream.
public ImageDctHashSearchCriteria(String filePath)
Initializes a new instance of the [ImageDctHashSearchCriteria](../../com.groupdocs.watermark.search/imagedcthashsearchcriteria) class with a specified file path.
Parameters:
Parameter
Type
Description
filePath
java.lang.String
The file path to load image from.
ImageDctHashSearchCriteria(InputStream stream)
public ImageDctHashSearchCriteria(InputStream stream)
Initializes a new instance of the [ImageDctHashSearchCriteria](../../com.groupdocs.watermark.search/imagedcthashsearchcriteria) class with a specified stream.