| Constructor and Description |
|---|
SvgImage(byte[] data)
Creates new SvgImage object.
|
SvgImage(byte[] data,
IExternalResourceResolver externalResResolver,
java.lang.String baseUri)
Creates new SvgImage object.
|
SvgImage(java.io.InputStream stream)
Creates new SvgImage object.
|
SvgImage(java.io.InputStream stream,
IExternalResourceResolver externalResResolver,
java.lang.String baseUri)
Creates new SvgImage object.
|
SvgImage(java.lang.String svgContent)
Creates new SvgImage object.
|
SvgImage(java.lang.String svgContent,
IExternalResourceResolver externalResResolver,
java.lang.String baseUri)
Creates new SvgImage object.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getBaseUri()
Returns base URI of the specified Svg.
|
IExternalResourceResolver |
getExternalResourceResolver()
Return callback interface used to resolve external resources during Svg documents import.
|
java.lang.String |
getSvgContent()
Returns SVG content.
|
byte[] |
getSvgData()
Returns SVG data.
|
void |
writeAsEmf(java.io.OutputStream stream)
Saves the SVG image as an EMF file.
|
public SvgImage(byte[] data)
Creates new SvgImage object.
data - Svg data.public SvgImage(java.lang.String svgContent)
Creates new SvgImage object.
svgContent - Svg content.public SvgImage(java.io.InputStream stream)
Creates new SvgImage object.
stream - Svg stream.public SvgImage(byte[] data,
IExternalResourceResolver externalResResolver,
java.lang.String baseUri)
Creates new SvgImage object.
data - Svg data.externalResResolver - A callback object used to fetch external objects. If this parameter is null all external objects will be ignored.baseUri - Base URI of the specified Svg. Used to resolve relative links.public SvgImage(java.lang.String svgContent,
IExternalResourceResolver externalResResolver,
java.lang.String baseUri)
Creates new SvgImage object.
svgContent - Svg content.externalResResolver - A callback object used to fetch external objects. If this parameter is null all external objects will be ignored.baseUri - Base URI of the specified Svg. Used to resolve relative links.public SvgImage(java.io.InputStream stream,
IExternalResourceResolver externalResResolver,
java.lang.String baseUri)
Creates new SvgImage object.
stream - Svg stream.externalResResolver - A callback object used to fetch external objects. If this parameter is null all external objects will be ignored.baseUri - Base URI of the specified Svg. Used to resolve relative links.public final byte[] getSvgData()
Returns SVG data.
Read-only byte[].
getSvgData in interface ISvgImagepublic final IExternalResourceResolver getExternalResourceResolver()
Return callback interface used to resolve external resources during Svg documents import.
Read-only IExternalResourceResolver.
getExternalResourceResolver in interface ISvgImagepublic final java.lang.String getBaseUri()
Returns base URI of the specified Svg. Used to resolve relative links.
Read-only String.
getBaseUri in interface ISvgImagepublic final java.lang.String getSvgContent()
Returns SVG content.
Read-only String.
getSvgContent in interface ISvgImagepublic final void writeAsEmf(java.io.OutputStream stream)
Saves the SVG image as an EMF file.
The following example shows how to save the SVG image to the metafile.// Creates the new SVG image ISvgImage svgImage = new SvgImage(new FileInputStream("content.svg")); // Saves the SVG image as a metafille FileOutputStream fileStream = new FileOutputStream("SvgAsEmf.emf"); svgImage.writeAsEmf(fileStream);This sample demonstrates how to add the SVG image as a metafile to the presentation image collection.Presentation pres = new Presentation(); try { // Creates the new SVG image ISvgImage svgImage = new SvgImage(new FileInputStream("content.svg")); ByteArrayOutputStream byteStream = new ByteArrayOutputStream(); // Saves the SVG image as a metafille svgImage.writeAsEmf(byteStream); // Adds metafile to the image collection pres.getImages().addImage(byteStream.toByteArray()); } finally { if (pres != null) pres.dispose(); }
writeAsEmf in interface ISvgImagestream - Target streamcom.aspose.ms.System.ArgumentNullException - Target stream is nullCopyright © 2004-2025 Aspose Pty Ltd. All Rights Reserved.