WatermarkableImage
Contents
[
Hide
]
WatermarkableImage class
Represents an image inside a document.
public abstract class WatermarkableImage : ContentPart
Properties
Name | Description |
---|---|
Height { get; } | Gets the height of this WatermarkableImage in pixels. |
Width { get; } | Gets the width of this WatermarkableImage in pixels. |
Methods
Name | Description |
---|---|
Add(Watermark) | Adds a watermark to this WatermarkableImage . This method assumes that watermark offset and size are measured in pixels (if they are assigned). |
FindImages() | Finds all images in the content. The search is conducted in the objects specified in SearchableObjects . |
FindImages(ImageSearchCriteria) | Finds images according to the specified search criteria. The search is conducted in the objects specified in SearchableObjects . |
GetBytes() | Gets the image as byte array. |
Search() | Finds all possible watermarks in the content. The search is conducted in the objects specified in SearchableObjects . |
Search(SearchCriteria) | Finds possible watermarks according to specified search criteria. The search is conducted in the objects specified in SearchableObjects . |
Remarks
Learn more:
Examples
Add watermark to all images inside a document of any supported type.
using (Watermarker watermarker = new Watermarker(@"D:\input.doc"))
{
// Initialize text or image watermark.
TextWatermark watermark = new TextWatermark("DRAFT", new Font("Arial", 19));
// Find all images in the content.
WatermarkableImageCollection images = watermarker.GetImages();
// Add watermark.
foreach (WatermarkableImage watermarkableImage in images)
{
watermarkableImage.Add(watermark);
}
// Save changes.
watermarker.Save(@"D:\output.doc");
}
See Also
- class ContentPart
- namespace GroupDocs.Watermark.Contents.Image
- assembly GroupDocs.Watermark