Aspose.SVG
22.1.0
See the version list below for details.
dotnet add package Aspose.SVG --version 22.1.0
NuGet\Install-Package Aspose.SVG -Version 22.1.0
<PackageReference Include="Aspose.SVG" Version="22.1.0" />
paket add Aspose.SVG --version 22.1.0
#r "nuget: Aspose.SVG, 22.1.0"
// Install Aspose.SVG as a Cake Addin
#addin nuget:?package=Aspose.SVG&version=22.1.0
// Install Aspose.SVG as a Cake Tool
#tool nuget:?package=Aspose.SVG&version=22.1.0
PNG to SVG Conversion & Rendering .NET API
Product Page | Docs | API Reference | Examples | Blog | Search | Free Support | Temporary License
This .NET on-premise API helps you seamlessly integrate SVG file processing & manipulation functionality into your C#, VB.NET, ASP.NET & other .NET based Apps.
SVG File Processing Features
- Create, read and write SVG format files.
- Convert SVG to other supported file formats.
- DOM Tree manipulation as per official SVG specs.
- Support for content navigation via XPath Query, CSS Selectors, Element, and Document Traversal features.
- Support for quality rendering.
What's new in v22.1.0
Font Matching
Support for matching fonts to individual runs of text. A font family is chosen for each character in the run. While a particular font face containing a suitable glyph for that character is selected.
The following C# code snippet shows how you may arrange text within a vector image by playing with text direction, orientation, styles, font colors, reverse font, and many other text & font settings:
1 <svg height="300" width="400" xmlns="http://www.w3.org/2000/svg">
2 <text x="180" y="30" fill="red">Aspose.SVG</text>
3 <text x="180" y="60" fill="blue" textLength="140" >Aspose.SVG</text>
4 <text x="180" y="90" fill="grey" textLength="160" lengthAdjust="spacingAndGlyphs" style="direction: rtl; unicode-bidi: bidi-override">Aspose.SVG</text>
5 <text x="180" y="120" fill="green" style="text-anchor: middle" >Aspose.SVG</text>
6 <text x="260" y="90" style="writing-mode: tb">Aspose.SVG</text>
7</svg>
Optimized Memory Management for SVG Filters
Better memory management while applying SVG filters to vector graphics. The following C# code sample demonstrates how to create a drop shadow effect via API:
1<svg height="200" width="200" xmlns="http://www.w3.org/2000/svg">
2 <defs>
3 <filter id="shadow" x="-20" y="-20" height="150" width="150">
4 <feOffset result="offset" in="SourceAlpha" dx="10" dy="10" />
5 <feGaussianBlur result="blur" in="offset" stdDeviation="10" />
6 <feBlend in="SourceGraphic" in2="blur" mode="normal" />
7 </filter>
8 </defs>
9 <ellipse cx="95" cy="90" rx="75" ry="55" fill="#20B2AA" filter="url(#shadow)" />
10</svg>
No Resolution Loss for Inline SVG Rendering
The loss of resolution was an issue while rendering inline SVG vector graphics. This issue has been resolved now. It has also improved the vectorization quality of raster graphics.
The following is an example program code of how to vectorize raster images by converting a raster PNG image to vector SVG graphic using C# code via API:
using System.IO;
using Aspose.Svg.ImageVectorization;
using Aspose.Svg.Saving;
...
var vectorizer = new ImageVectorizer
{
Configuration =
{
TraceSmoother = new ImageTraceSmoother(2),
TraceSimplifier = new ImageTraceSimplifier(0.1f),
ColorsLimit = 2
}
};
using var document = vectorizer.Vectorize(Path.Combine(DataDir, "png-to-svg.png"));
document.Save(Path.Combine(OutputDir, "png-to-svg.svg"));
For a complete list of features, enhancements, and bug fixes in this release please visit, Aspose.SVG for .NET 22.1 Release Notes.
Read Supported Formats
SVG
Save SVG As
Fixed Layout: PDF, XPS
Image: TIFF, BMP, PNG, JPEG, GIF
Platform Independence
Any operating system that can install Mono (.NET 4.0 Framework support) or use .NET core can use Aspose.SVG for .NET. This includes Windows, Linux, and macOS.
Get Started
Are you ready to give Aspose.SVG for .NET a try? Simply execute Install-Package Aspose.SVG
from Package Manager Console in Visual Studio to fetch the NuGet package. If you already have Aspose.SVG for .NET and want to upgrade the version, please execute Update-Package Aspose.SVG
to get the latest version.
Use C# to Convert SVG to PNG format
string dataDir = RunExamples.GetDataDir_Data();
using (var document = new SVGDocument(Path.Combine(dataDir, "sourcefile.svg"))){
using (var device = new ImageDevice(new ImageRenderingOptions(ImageFormat.Png), dataDir + "targetfile.png")){
document.RenderTo(device);
}
}
Product Page | Docs | API Reference | Examples | Blog | Search | Free Support | Temporary License
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net20 is compatible. net35 is compatible. net35-client is compatible. net40 is compatible. net40-client is compatible. net403 was computed. net45 was computed. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 2.0
- No dependencies.
-
.NETFramework 3.5
- No dependencies.
-
.NETFramework 3.5 Client
- No dependencies.
-
.NETFramework 4.0
- No dependencies.
-
.NETFramework 4.0 Client
- No dependencies.
-
.NETStandard 2.0
- System.Drawing.Common (>= 4.5.0)
- System.Security.Permissions (>= 4.5.0)
- System.Text.Encoding.CodePages (>= 4.5.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Aspose.SVG:
Package | Downloads |
---|---|
Aspose.Total
Aspose.Total for .NET is the most complete package of all .NET file format APIs offered by Aspose. It empowers developers to create, edit, render, print and convert between a wide range of popular document formats within any .NET, C#, ASP.NET and VB.NET applications. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
23.5.0 | 180 | 5/25/2023 |
23.4.0 | 2,039 | 4/19/2023 |
23.3.0 | 3,892 | 3/21/2023 |
23.2.0 | 3,634 | 2/28/2023 |
23.1.0 | 14,863 | 1/31/2023 |
22.12.0 | 718 | 1/17/2023 |
22.11.0 | 9,346 | 11/25/2022 |
22.10.0 | 5,190 | 10/31/2022 |
22.9.0 | 10,434 | 9/30/2022 |
22.8.0 | 11,799 | 8/30/2022 |
22.7.0 | 12,463 | 7/27/2022 |
22.6.0 | 9,605 | 6/21/2022 |
22.5.0 | 5,059 | 5/20/2022 |
22.4.0 | 5,150 | 4/21/2022 |
22.3.0 | 9,271 | 3/12/2022 |
22.2.0 | 10,239 | 2/17/2022 |
22.1.0 | 3,892 | 1/16/2022 |
21.12.0 | 5,721 | 12/3/2021 |
21.11.0 | 4,300 | 11/3/2021 |
21.10.0 | 4,272 | 10/12/2021 |
21.9.0 | 9,341 | 9/7/2021 |
21.8.0 | 6,898 | 8/5/2021 |
21.7.0 | 8,384 | 7/2/2021 |
21.6.0 | 2,161 | 6/3/2021 |
21.5.0 | 5,403 | 5/12/2021 |
21.4.0 | 14,042 | 4/9/2021 |
21.3.0 | 6,453 | 3/12/2021 |
21.2.0 | 7,158 | 2/10/2021 |
21.1.0 | 2,610 | 1/25/2021 |
20.12.0 | 2,172 | 12/14/2020 |
20.11.0 | 5,533 | 11/12/2020 |
20.10.0 | 1,845 | 10/29/2020 |
20.9.0 | 3,434 | 9/25/2020 |
20.8.0 | 2,871 | 8/21/2020 |
20.7.0 | 17,091 | 7/31/2020 |
20.6.0 | 1,659 | 6/30/2020 |
20.5.0 | 1,580 | 5/29/2020 |
20.4.0 | 9,255 | 4/28/2020 |
20.2.0 | 1,824 | 2/27/2020 |
20.1.0 | 1,469 | 1/30/2020 |