public final class EmfImage extends MetaImageBase
Represents one vector image in Enhanced metafile format (EMF) format with its metadata and additional methods
Disposed
Constructor and Description |
---|
EmfImage(String name,
InputStream binaryContent)
Creates new EmfImage instance from content, represented as byte stream,
and with specified name
|
EmfImage(String name,
String contentInBase64)
Creates new EmfImage instance from content, represented as base64-encoded
string, and with specified name
|
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Disposes this EMF image by disposing its content and making most its
methods and properties non-working
|
InputStream |
getByteContent()
Returns a content of this EMF image as a binary stream
|
String |
getTextContent()
Returns a content of this EMF image as a plain text
|
ImageType |
getType()
Returns ImageType.Emf
|
static boolean |
isValid(InputStream binaryContent)
Checks whether specified stream is a valid EMF image
|
static boolean |
isValid(String contentInBase64)
Checks whether specified base64-encoded string is a valid EMF image
|
void |
save(String fullPathToFile)
Saves this EMF image to the file
|
void |
saveToPng(InputStream outputPngContent)
Saves this vector EMF image into raster PNG image
|
void |
saveToSvg(OutputStream outputSvgContent)
Saves this vector EMF image into vector SVG image
|
isValidEmf, isValidEmf, isValidWmf, isValidWmf
equals, getAspectRatio, getFilenameWithExtension, getLinearDimensions, getName, isDisposed
public EmfImage(String name, InputStream binaryContent)
Creates new EmfImage instance from content, represented as byte stream, and with specified name
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.com.aspose.ms.System.ArgumentException
public EmfImage(String name, String contentInBase64)
Creates new EmfImage instance from content, represented as base64-encoded string, and with specified name
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.com.aspose.ms.System.ArgumentException
public void dispose()
Disposes this EMF image by disposing its content and making most its methods and properties non-working
dispose
in interface com.groupdocs.editor.interfaces.IDisposable
dispose
in class VectorImageResourceBase
public InputStream getByteContent()
Returns a content of this EMF image as a binary stream
getByteContent
in interface IHtmlResource
getByteContent
in class VectorImageResourceBase
public String getTextContent()
Returns a content of this EMF image as a plain text
getTextContent
in interface IHtmlResource
getTextContent
in class VectorImageResourceBase
public ImageType getType()
Returns ImageType.Emf
getType
in interface IHtmlResource
getType
in interface IImageResource
getType
in class VectorImageResourceBase
public static boolean isValid(InputStream binaryContent)
Checks whether specified stream is a valid EMF image
binaryContent
- Input byte stream. Cannot be NULL, should support
reading and seeking.public static boolean isValid(String contentInBase64)
Checks whether specified base64-encoded string is a valid EMF image
contentInBase64
- Input string, where content of EMF image is stored
in base64 encoding. Cannot be NULL or empty.public void save(String fullPathToFile)
Saves this EMF image to the file
save
in interface IHtmlResource
save
in class VectorImageResourceBase
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
imagepublic void saveToPng(InputStream outputPngContent)
Saves this vector EMF image into raster PNG image
saveToPng
in class VectorImageResourceBase
outputPngContent
- Output stream, into which the content of PNG
image will be written. Cannot be NULL and should be writable.public void saveToSvg(OutputStream outputSvgContent) throws Exception
Saves this vector EMF image into vector SVG image
saveToSvg
in class MetaImageBase
outputSvgContent
- Output stream, into which the content of SVG
image will be written. Cannot be NULL and should be writable.Exception