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

Class WmfImage

    • Constructor Detail

      • WmfImage

        public WmfImage(String name,
                InputStream binaryContent)

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

        Parameters:
        name - Name of the WMF 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:
        com.aspose.ms.System.ArgumentException
        com.groupdocs.editor.htmlcss.exceptions.InvalidImageFormatException
      • WmfImage

        public WmfImage(String name,
                com.aspose.ms.System.IO.Stream binaryContent)
      • WmfImage

        public WmfImage(String name,
                String contentInBase64)

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

        Parameters:
        name - Name of the WMF image. Cannot be null, empty or whitespaces.
        contentInBase64 - Content as base64-encoded string. Cannot be null, empty or whitespaces. If it is not a WMF content, exception will be thrown.
        Throws:
        com.aspose.ms.System.ArgumentException
        com.groupdocs.editor.htmlcss.exceptions.InvalidImageFormatException
    • Method Detail

      • dispose

        public void dispose()

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

        Specified by:
        dispose in interface com.aspose.ms.System.IDisposable
        Specified by:
        dispose in class VectorImageResourceBase
      • isValid

        public static boolean isValid(InputStream binaryContent)

        Checks whether specified stream is a valid WMF image

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

        public static boolean isValid(String contentInBase64)

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

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

        public static boolean isValidInternal(com.aspose.ms.System.IO.Stream binaryContent)
      • save

        public void save(String fullPathToFile)

        Saves this WMF 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 WMF image
      • saveToPng

        public final void saveToPng(InputStream outputPngContent)

        Saves this vector WMF image into raster PNG image

        Parameters:
        outputPngContent - Output stream, into which the content of PNG image will be written. Cannot be NULL and should be writeable.
      • saveToPngInternal

        public void saveToPngInternal(com.aspose.ms.System.IO.Stream outputPngContent)
      • saveToSvg

        public final void saveToSvg(InputStream outputSvgContent)

        Saves this vector WMF image into vector SVG image

        Parameters:
        outputSvgContent - Output stream, into which the content of SVG image will be written. Cannot be NULL and should be writeable.
      • saveToSvgInternal

        public void saveToSvgInternal(com.aspose.ms.System.IO.Stream outputSvgContent)