com.groupdocs.editor.htmlcss.resources.images.vector

Class EmfImage

    • Constructor Detail

      • EmfImage

        public EmfImage(String name,
                        InputStream binaryContent)

        Creates new EmfImage instance from content, represented as byte stream, and with specified name

        Parameters:
        name - Name of the EMF image. Cannot be null, empty or whitespaces.
        binaryContent - Content as byte stream. Reading begins from original position. Cannot be null. Should be readable and seekable. If this instance will be disposed, this stream will be disposed too.
        Throws:
        IllegalArgumentException
      • EmfImage

        public EmfImage(String name,
                        String contentInBase64)

        Creates new EmfImage instance from content, represented as base64-encoded string, and with specified name

        Parameters:
        name - Name of the EMF image. Cannot be null, empty or whitespaces.
        contentInBase64 - Content as base64-encoded string. Cannot be null, empty or whitespaces. If it is not a EMF content, exception will be thrown.
        Throws:
        IllegalArgumentException
    • Method Detail

      • dispose

        public void dispose()

        Disposes this EMF image by disposing its content and making most its methods and properties non-working

        Specified by:
        dispose in interface IDisposable
        Specified by:
        dispose in class VectorImageResourceBase
      • isValid

        public static boolean isValid(InputStream binaryContent)

        Checks whether specified stream is a valid EMF image

        Parameters:
        binaryContent - Input byte stream. Cannot be NULL, should support reading and seeking.
        Returns:
        True if specified stream holds a valid EMF image, false otherwise
      • isValid

        public static boolean isValid(String contentInBase64)

        Checks whether specified base64-encoded string is a valid EMF image

        Parameters:
        contentInBase64 - Input string, where content of EMF image is stored in base64 encoding. Cannot be NULL or empty.
        Returns:
        True if specified string holds a valid EMF image, false otherwise
      • save

        public void save(String fullPathToFile)

        Saves this EMF image to the file

        Specified by:
        save in interface IHtmlResource
        Specified by:
        save in class VectorImageResourceBase
        Parameters:
        fullPathToFile - Full path to the file, which will be created (if it doesn't exist) or overwritten (if exists) with the content of this EMF image
      • saveToPng

        public void saveToPng(InputStream outputPngContent)

        Saves this vector EMF image into raster PNG image

        Specified by:
        saveToPng in class VectorImageResourceBase
        Parameters:
        outputPngContent - Output stream, into which the content of PNG image will be written. Cannot be NULL and should be writable.
      • saveToSvg

        public void saveToSvg(OutputStream outputSvgContent)
                       throws Exception

        Saves this vector EMF image into vector SVG image

        Specified by:
        saveToSvg in class MetaImageBase
        Parameters:
        outputSvgContent - Output stream, into which the content of SVG image will be written. Cannot be NULL and should be writable.
        Throws:
        Exception