public final class SvgImage extends VectorImageResourceBase
Represents one vector image in SVG (Scalable Vector Graphics) format with its metadata and additional methods
Disposed
Constructor and Description |
---|
SvgImage(String name,
InputStream binaryContent)
Creates new SvgImage instance from content, represented as byte stream,
and with specified name
|
SvgImage(String name,
com.aspose.ms.System.IO.Stream binaryContent) |
SvgImage(String name,
String content)
Creates new SvgImage instance from content, represented as usual string,
and with specified name
|
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Disposes this raster image, disposing its content and making most methods
and properties non-working
|
InputStream |
getByteContent()
Returns a content of this SVG image as a binary stream
|
com.aspose.ms.System.IO.Stream |
getByteContentInternal() |
String |
getTextContent()
Returns a content of this SVG image as a plain text (in XML format)
|
ImageType |
getType()
Returns ImageType.Svg
|
static boolean |
isValid(String content)
Performs a surface check whether specified textual content represents a
SVG image
|
void |
save(String fullPathToFile)
Saves this SVG image to the file
|
equals, getAspectRatio, getFilenameWithExtension, getLinearDimensions, getName, isDisposed
public SvgImage(String name, InputStream binaryContent)
Creates new SvgImage instance from content, represented as byte stream, and with specified name
name
- Name of the SVG 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
com.groupdocs.editor.htmlcss.exceptions.InvalidImageFormatException
public SvgImage(String name, com.aspose.ms.System.IO.Stream binaryContent)
public SvgImage(String name, String content)
Creates new SvgImage instance from content, represented as usual string, and with specified name
name
- Name of the SVG image. Cannot be null, empty or whitespaces.content
- Content as a usual string. Cannot be null, empty or
whitespaces. If it is not a SVG content, exception will be thrown.public void dispose()
Disposes this raster image, disposing its content and making most methods and properties non-working
dispose
in interface com.aspose.ms.System.IDisposable
dispose
in class VectorImageResourceBase
public InputStream getByteContent()
Returns a content of this SVG image as a binary stream
getByteContent
in interface IHtmlResource
getByteContent
in class VectorImageResourceBase
public com.aspose.ms.System.IO.Stream getByteContentInternal()
getByteContentInternal
in interface IHtmlResource
getByteContentInternal
in class VectorImageResourceBase
public String getTextContent()
Returns a content of this SVG image as a plain text (in XML format)
getTextContent
in interface IHtmlResource
getTextContent
in class VectorImageResourceBase
public ImageType getType()
Returns ImageType.Svg
getType
in interface IHtmlResource
getType
in interface IImageResource
getType
in class VectorImageResourceBase
public static boolean isValid(String content)
Performs a surface check whether specified textual content represents a SVG image
content
- XML content of an SVG image as simple textpublic void save(String fullPathToFile)
Saves this SVG 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 SVG
imageCopyright © 2020. All rights reserved.