<svg viewBox="0 0 300 300" xmlns="http://www.w3.org/2000/svg">
<style>
div {
color: grey;
font: 14px serif;
}
</style>
<circle cx="65" cy="60" r="60" fill="red" fill-opacity="0.1" />
<foreignObject x="20" y="20" width="200" height="180">
<!--In the context of HTML embedded in the SVG document, the XHTML namespace is mandatory-->
<div xmlns="http://www.w3.org/1999/xhtml">
Convert SVG to PNG. Aspose.SVG for .NET can read and convert SVG files to PNG, PDF, XPS, and major image formats.
</div>
</foreignObject>
</svg>
To save as WebP:
var fileStream = new StreamReader($"input.svg").BaseStream;
using SvgImage image = (SvgImage)Image.Load(fileStream);
using FileStream fs = new FileStream("output.webp", FileMode.Create, FileAccess.ReadWrite);
image.Save(fs, new WebPOptions());
Can you please try using the latest Aspose.Imaging for .NET 21.10 on your end. In case there is still an issue then please share the generated file reproducing the issue.
We need to investigate this further on our end and a ticket with ID IMAGINGNET-4863 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.
Hello, @markus.michel
We apologize for the long silence on this issue.
Regarding your question, we can inform you of the following:
Aspose.Imaging does not support embedded HTML in SVG and its support is not planned.
If you need this functionality, then please pay attention to Aspose.SVG
that implements the required functionality. Besides Aspose.SVG allows you to export SVG
to various raster formats, for example, PNG.
Please familiarize yourself with the supported formats here
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
Enables storage, such as cookies, related to analytics.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.