public class Watermarker extends Object implements Closeable
Represents a class for watermark management in a document.
Constructor and Description |
---|
Watermarker(InputStream document)
Creates a new Watermarker class for a document from the specified stream.
|
Watermarker(InputStream document,
LoadOptions options)
Creates a new Watermarker class for a document from the specified stream.
|
Watermarker(InputStream document,
LoadOptions options,
WatermarkerSettings settings)
Creates a new Watermarker class for a document from the specified stream.
|
Watermarker(InputStream document,
WatermarkerSettings settings)
Creates a new Watermarker class for a document from the specified stream.
|
Watermarker(String filePath)
Creates a new Watermarker class for a document from the specified file.
|
Watermarker(String filePath,
LoadOptions options)
Creates a new Watermarker class for a document from the specified file.
|
Watermarker(String filePath,
LoadOptions options,
WatermarkerSettings settings)
Creates a new Watermarker class for a document from the specified file.
|
Watermarker(String filePath,
WatermarkerSettings settings)
Creates a new Watermarker class for a document from the specified file.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Watermark watermark)
Adds a watermark to the loaded document.
|
void |
add(Watermark watermark,
WatermarkOptions options)
Adds a watermark to the loaded document.
|
void |
close()
Disposes the current instance.
|
void |
generatePreview(PreviewOptions previewOptions)
Generates preview images for the document.
|
<T extends Content> |
getContent(Class<T> contentType)
Returns the
Content object for the loaded document. |
IDocumentInfo |
getDocumentInfo()
Gets the information about the format of loaded document.
|
WatermarkableImageCollection |
getImages()
Finds all images in the document.
|
WatermarkableImageCollection |
getImages(ImageSearchCriteria searchCriteria)
Finds images according to specified search criteria.
|
SearchableObjects |
getSearchableObjects()
Gets the content objects that are to be included in a watermark search.
|
void |
remove(PossibleWatermark possibleWatermark)
Removes watermark from the document.
|
void |
remove(PossibleWatermarkCollection possibleWatermarks)
Removes all watermarks in the collection from the document.
|
void |
save(OutputStream document)
Saves the document to the specified stream.
|
void |
save(OutputStream document,
SaveOptions options)
Saves the document to the specified stream.
|
void |
save(String filePath)
Saves the document to the specified file location.
|
void |
save(String filePath,
SaveOptions options)
Saves the document to the specified file location.
|
PossibleWatermarkCollection |
search()
Searches all possible watermarks in the document.
|
PossibleWatermarkCollection |
search(SearchCriteria searchCriteria)
Searches possible watermarks according to specified search criteria.
|
void |
setSearchableObjects(SearchableObjects value)
Sets the content objects that are to be included in a watermark search.
|
public Watermarker(String filePath)
Creates a new Watermarker class for a document from the specified file.
filePath
- The file path to load document from.UnsupportedFileTypeException
- Supplied document type is not supported.public Watermarker(String filePath, LoadOptions options)
Creates a new Watermarker class for a document from the specified file.
filePath
- The file path to load document from.options
- Additional options to use when loading a document.UnsupportedFileTypeException
- Supplied document type is not supported.public Watermarker(String filePath, WatermarkerSettings settings)
Creates a new Watermarker class for a document from the specified file.
filePath
- The file path to load document from.settings
- Additional settings to use when working with loaded document.UnsupportedFileTypeException
- Supplied document type is not supported.public Watermarker(String filePath, LoadOptions options, WatermarkerSettings settings)
Creates a new Watermarker class for a document from the specified file.
filePath
- The file path to load document from.options
- Additional options to use when loading a document.settings
- Additional settings to use when working with loaded document.UnsupportedFileTypeException
- Supplied document type is not supported.public Watermarker(InputStream document)
Creates a new Watermarker class for a document from the specified stream.
document
- The stream to load document from.UnsupportedFileTypeException
- Supplied document type is not supported.public Watermarker(InputStream document, LoadOptions options)
Creates a new Watermarker class for a document from the specified stream.
document
- The stream to load document from.options
- Additional options to use when loading a document.UnsupportedFileTypeException
- Supplied document type is not supported.public Watermarker(InputStream document, WatermarkerSettings settings)
Creates a new Watermarker class for a document from the specified stream.
document
- The stream to load document from.settings
- Additional settings to use when working with loaded document.UnsupportedFileTypeException
- Supplied document type is not supported.public Watermarker(InputStream document, LoadOptions options, WatermarkerSettings settings)
Creates a new Watermarker class for a document from the specified stream.
document
- The stream to load document from.options
- Additional options to use when loading a document.settings
- Additional settings to use when working with loaded document.UnsupportedFileTypeException
- Supplied document type is not supported.public final SearchableObjects getSearchableObjects()
Gets the content objects that are to be included in a watermark search.
Note, this property also specifies content objects which are used in image search.
For more information see Search(SearchCriteria)
and GetImages()
methods.
public final void setSearchableObjects(SearchableObjects value)
Sets the content objects that are to be included in a watermark search.
Note, this property also specifies content objects which are used in image search.
For more information see Search(SearchCriteria)
and GetImages()
methods.
value
- The objects that are to be included in a watermark search.public final void close()
Disposes the current instance.
close
in interface Closeable
close
in interface AutoCloseable
public final IDocumentInfo getDocumentInfo()
Gets the information about the format of loaded document.
IDocumentInfo
instance that contains detected information.public final void add(Watermark watermark)
Adds a watermark to the loaded document.
watermark
- The watermark to add to the document.public final void add(Watermark watermark, WatermarkOptions options)
Adds a watermark to the loaded document.
watermark
- The watermark to add to the document.options
- Additional options to use when adding the watermark.public final void remove(PossibleWatermark possibleWatermark)
Removes watermark from the document.
possibleWatermark
- The watermark to remove.public final void remove(PossibleWatermarkCollection possibleWatermarks)
Removes all watermarks in the collection from the document.
possibleWatermarks
- The collection of watermarks to remove.public final void save(String filePath)
Saves the document to the specified file location.
filePath
- The file path to save the document data to.public final void save(OutputStream document)
Saves the document to the specified stream.
document
- The stream to save the document data to.public final void save(String filePath, SaveOptions options)
Saves the document to the specified file location.
filePath
- The file path to save the document data to.options
- Additional options to use when saving a document.public final void save(OutputStream document, SaveOptions options)
Saves the document to the specified stream.
document
- The stream to save the document data to.options
- Additional options to use when saving a document.public final void generatePreview(PreviewOptions previewOptions)
Generates preview images for the document.
previewOptions
- Additional options to use when generating preview images.public final PossibleWatermarkCollection search()
Searches all possible watermarks in the document.
The search is conducted in objects specified in SearchableObjects
.
public final PossibleWatermarkCollection search(SearchCriteria searchCriteria)
Searches possible watermarks according to specified search criteria.
The search is conducted in objects specified in SearchableObjects
.
searchCriteria
- The search criteria to use.public final WatermarkableImageCollection getImages(ImageSearchCriteria searchCriteria)
Finds images according to specified search criteria.
The search is conducted in objects specified in SearchableObjects
.
searchCriteria
- The search criteria to use.public final WatermarkableImageCollection getImages()
Finds all images in the document.
The search is conducted in objects specified in SearchableObjects
.
Copyright © 2020. All rights reserved.