Class ImageMask

    • Method Detail

      • create

        public static ImageMask create​(Document targetDocument,
                                       Stream stream)
                                throws java.io.IOException,
                                       UnknownFormatException,
                                       CorruptException

        Create an image mask object from image data.

        Supported formats are:
        • BMP
        • DIB
        • JBIG2
        • PNG
        • GIF
        The returned image mask object is not yet painted on any page, but it is associated with the given target document.
        Parameters:
        targetDocument - the output document with which the returned object is associated
        stream - the image data stream
        Returns:
        the newly created image mask object
        Throws:
        java.io.IOException - Error reading from the image or writing to the document
        UnknownFormatException - The image data has an unknown format or the format is not suitable for an image mask
        CorruptException - The image data is corrupt
        java.lang.IllegalArgumentException - if the targetDocument argument has already been closed
        java.lang.IllegalArgumentException - if the targetDocument argument is read-only
        java.lang.IllegalArgumentException - if the stream argument is null
        java.lang.IllegalArgumentException - if targetDocument is null
        java.lang.IllegalArgumentException - if stream is null
      • getSize

        public Size getSize()

        The size of the image mask in samples. (Getter)

        Throws:
        java.lang.IllegalStateException - if the image has already been closed