public final class SvgImage extends Object implements IImageResource
Represents one vector image in SVG (Scalable Vector Graphics) format with its metadata and additional methods
Modifier and Type | Field and Description |
---|---|
com.groupdocs.editor.events.ProcessEvents<com.groupdocs.editor.events.ProcessEventHandler> |
Disposed
Event, which occurs right after when this SVG image is 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,
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
|
boolean |
equals(IHtmlResource other)
Checks this instance with specified on reference equality.
|
boolean |
equals(Object obj)
Determines whether the specified Object is equal to the current Object.
|
Ratio |
getAspectRatio()
Returns aspect ratio of this SVG image
|
InputStream |
getByteContent()
Returns a content of this SVG image as a binary stream
|
String |
getFilenameWithExtension()
Returns correct filename of this SVG image, which consists of name and extension.
|
Dimensions |
getLinearDimensions()
Returns linear dimensions of this SVG image (width and height), if they are present, or empty default Dimensions instance otherwise
|
String |
getName()
Returns name of this SVG image.
|
String |
getTextContent()
Returns a content of this SVG image as a plain text (in XML format)
|
ImageType |
getType()
Returns ImageType.Svg
|
int |
hashCode()
Serves as a hash function for a particular type.
|
boolean |
isDisposed()
Determines whether this SVG image is disposed or not
|
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
|
public final com.groupdocs.editor.events.ProcessEvents<com.groupdocs.editor.events.ProcessEventHandler> Disposed
Event, which occurs right after when this SVG image is disposed
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 seakable. If this instance will be disposed, this stream will be disposed too.Exception
com.groupdocs.editor.htmlcss.exceptions.InvalidImageFormatException
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
public boolean equals(IHtmlResource other)
Checks this instance with specified on reference equality.
other
- IHtmlResourcepublic boolean equals(Object obj)
Determines whether the specified Object is equal to the current Object.
public Ratio getAspectRatio()
Returns aspect ratio of this SVG image
getAspectRatio
in interface IImageResource
public InputStream getByteContent()
Returns a content of this SVG image as a binary stream
getByteContent
in interface IHtmlResource
public String getFilenameWithExtension()
Returns correct filename of this SVG image, which consists of name and extension. Theoretically can differ from the name.
getFilenameWithExtension
in interface IHtmlResource
public Dimensions getLinearDimensions()
Returns linear dimensions of this SVG image (width and height), if they are present, or empty default Dimensions instance otherwise
getLinearDimensions
in interface IImageResource
public String getName()
Returns name of this SVG image. Usually doesn't contain filename extension and theoretically can differ from filename.
getName
in interface IHtmlResource
public String getTextContent()
Returns a content of this SVG image as a plain text (in XML format)
getTextContent
in interface IHtmlResource
public ImageType getType()
Returns ImageType.Svg
getType
in interface IHtmlResource
getType
in interface IImageResource
public int hashCode()
Serves as a hash function for a particular type.
public boolean isDisposed()
Determines whether this SVG image is disposed or not
isDisposed
in interface IAuxDisposable
public static boolean isValid(String content)
Performs a surface check whether specified textual content represents a SVG image
content
- Specified textual content.public void save(String fullPathToFile)
Saves this SVG image to the file
save
in interface IHtmlResource
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 © 2018. All rights reserved.