com.groupdocs.watermark

Interfaces

Classes

Exceptions

com.groupdocs.watermark

Class ImageWatermark

  • All Implemented Interfaces:
    com.aspose.ms.System.IDisposable, Closeable, AutoCloseable


    public class ImageWatermark
    extends Watermark
    implements com.aspose.ms.System.IDisposable, Closeable

    Represents an image watermark.

    This example demonstrates how to add image watermark to a document of any supported format.

    Document document = Document.load("D:\\input.doc");
      
      // Create ImageWatermark instance.
      ImageWatermark watermark = new ImageWatermark("D:\\watermark.png");
      
      // Add watermark to the document.
      document.addWatermark(watermark);
      watermark.close();
      
      document.save("D:\\output.doc");
      document.close();
      
    • Constructor Detail

      • ImageWatermark

        public ImageWatermark(String filePath)

        Initializes a new instance of the ImageWatermark class.

        Parameters:
        filePath - Path to the image that will be used as watermark.
      • ImageWatermark

        public ImageWatermark(InputStream stream)

        Initializes a new instance of the ImageWatermark class.

        Parameters:
        stream - Stream containing the image that will be used as watermark.
    • Method Detail

      • dispose

        public final void dispose()

        Disposes the current instance.

        Specified by:
        dispose in interface com.aspose.ms.System.IDisposable