WatermarkableImage Class
Represents an image inside a document.
Inheritance Hierarchy
SystemObject
  GroupDocs.WatermarkDocumentPart
    GroupDocs.WatermarkWatermarkableImage
      More...

Namespace: GroupDocs.Watermark
Assembly: GroupDocs.Watermark (in GroupDocs.Watermark.dll) Version: 19.5
Syntax
public abstract class WatermarkableImage : DocumentPart

The WatermarkableImage type exposes the following members.

Properties
  NameDescription
Public propertyHeight
Gets the height of this WatermarkableImage in pixels.
Public propertyWidth
Gets the width of this WatermarkableImage in pixels.
Methods
  NameDescription
Public methodAddWatermark
Adds a watermark to this WatermarkableImage. This method assumes that watermark offset and size are measured in pixels (if they are assigned).
(Overrides DocumentPartAddWatermark(Watermark).)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodCode exampleFindImages
Finds all images in the document. The search is conducted in objects specified in SearchableObjects.
(Inherited from DocumentPart.)
Public methodFindImages(ImageSearchCriteria)
Finds images according to specified search criteria. The search is conducted in objects specified in SearchableObjects.
(Inherited from DocumentPart.)
Public methodFindWatermarks
Finds all possible watermarks in the document. The search is conducted in objects specified in SearchableObjects.
(Inherited from DocumentPart.)
Public methodCode exampleFindWatermarks(SearchCriteria)
Finds possible watermarks according to specified search criteria. The search is conducted in objects specified in SearchableObjects.
(Inherited from DocumentPart.)
Public methodGetBytes
Gets the image as byte array.
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Examples
Add watermark to all images inside a document of any supported type.
C#
using (Document document = Document.Load(@"D:\input.doc"))
{
    // Initialize text or image watermark.
    TextWatermark watermark = new TextWatermark("DRAFT", new Font("Arial", 19));

    // Find all images in the document.
    WatermarkableImageCollection images = document.FindImages();

    // Add watermark.
    foreach (WatermarkableImage watermarkableImage in images)
    {
        watermarkableImage.AddWatermark(watermark);
    }

    // Save changes.
    document.Save(@"D:\output.doc");
}
See Also
Inheritance Hierarchy