![]() |
VOOZH | about |
dotnet add package Aspose.SVG --version 26.5.0
NuGet\Install-Package Aspose.SVG -Version 26.5.0
<PackageReference Include="Aspose.SVG" Version="26.5.0" />
<PackageVersion Include="Aspose.SVG" Version="26.5.0" />Directory.Packages.props
<PackageReference Include="Aspose.SVG" />Project file
paket add Aspose.SVG --version 26.5.0
#r "nuget: Aspose.SVG, 26.5.0"
#:package Aspose.SVG@26.5.0
#addin nuget:?package=Aspose.SVG&version=26.5.0Install as a Cake Addin
#tool nuget:?package=Aspose.SVG&version=26.5.0Install as a Cake Tool
👁 Version 26.5.0
👁 NuGet
👁 .NET
👁 Product Page
👁 Docs
👁 Reference
👁 Examples
👁 Blog
👁 Releases
👁 Support
👁 License
Aspose.SVG for .NET is a powerful library designed to work with SVG documents in .NET applications. It allows developers to create, manipulate, and convert SVG files into various formats like PDF, SVGZ, PNG, JPG, TIFF, and more. The library supports SVG vectorization, custom configuration, document merging, transformations, and advanced features like gradients, filters, and path building. Perfect for developers aiming to enhance graphical content and automate SVG workflows in .NET environments.
SVGDocument() constructor to create a blank SVG document.SVGDocument() constructors.SVGDocument() constructors.SVG Builder API to programmatically construct and customize SVG documents in a streamlined manner.SVGDocument class.OnReadyStateChange event handler.CreateElementNS() method and InsertBefore() to append nodes.SetAttribute(), GetAttribute(), and other methods.DocumentElement, GetElementsByTagName(), and more.ConvertSVG() method to export SVG to PDF.ConvertSVG() method to convert SVG into XPS format.SVGSaveFormat enumeration of Aspose.Svg.Saving namespace specifies the format in which the document is saved, and you can select an SVG or SVGZ format.ImageRenderingOptions, PdfRenderingOptions, and XpsRenderingOptions.ImageVectorizer class.LogMessageHandler.Render() method.<text>, <tspan>, and apply glyphs and fonts.| Format | Description | Load | Save |
|---|---|---|---|
| SVG | Scalable Vector Graphics Format | ✔️ | ✔️ |
| SVGZ | Compressed version of SVG | ✔️ | ✔️ |
| Portable Document Format | ✔️ | ||
| XPS | XML Paper Specification | ✔️ | |
| TIFF | Tagged Image File Format | ✔️ | |
| BMP | Bitmap Image File Format | ✔️ | |
| PNG | Portable Network Graphics | ✔️ | |
| JPEG | Joint Photographic Expert Group | ✔️ | |
| GIF | Graphical Interchange Format | ✔️ |
To build and manipulate SVG documents, the machine running Aspose.SVG for .NET does not require modeling and rendering software installed. Aspose.SVG for .NET includes a document generation engine.
| Category | Details |
|---|---|
| Supported Operating System | |
| Windows | - Microsoft Windows Server 2022 (x64), - Microsoft Windows 2019 Server (x64), - Microsoft Windows 2016 Server (x64), - Microsoft Windows Server 2012 R2 (x64), - Microsoft Windows Server 2012 (x64), - Microsoft Windows Server 2008 R2 SP1 (x64), - Microsoft Windows Server 2008 SP2 (x64, x86), - Microsoft Windows 11 (x64), - Microsoft Windows 10 (x64, x86), - Microsoft Windows 8.1 (x64, x86), - Microsoft Windows 8 (x64, x86), - Microsoft Windows 7 SP1 (x64, x86), - Microsoft Azure |
| macOS | - Mac OS X x64 (10.12+) |
| Linux | - Linux x64 (6, 7, 27, 9, 8.7+, 18.04, 16.04, 14.04, 18, 17, 42.3+, 12 SP2+) |
| Development Environments | - Microsoft Visual Studio 2010, - Microsoft Visual Studio 2011, - Microsoft Visual Studio 2012, - Microsoft Visual Studio 2013, - Microsoft Visual Studio 2015, - Microsoft Visual Studio 2017, - Microsoft Visual Studio 2019 |
| Supported Frameworks | .NET Standard 2.0, Compatible with: - .NET Framework 4.6.1+, - .NET Standard 2.0/2.1, - .NET Core 2.0+, - .NET 5.0+ |
Tools > Extension Manager.Tools > Library Package Manager > Package Manager Console.Install-Package Aspose.SVG for the latest version or Install-Package Aspose.SVG -prerelease for the latest release with hotfixes.Package Manager Console again.Update-Package Aspose.SVG to update to the latest release, or use -prerelease for hotfixes.Tools > Library Package Manager > Manage NuGet Packages or right-click the project name in Solution Explorer.Aspose.SVG in the online package search.Aspose.SVG SVG Builder API employs the Fluent Builder Pattern, a design methodology that aligns perfectly with the need for simplicity, clarity, and versatility in SVG manipulation. The following example is a concise and elegant approach to creating SVG from scratch:
// Create an <svg> element with specified width, height and viewBox, and add into it other required elements
SVGSVGElement svg = new SVGSVGElementBuilder()
.Width(700).Height(300)
.ViewBox(0, 0, 700, 300)
.AddG(g => g
.AddCircle(circle => circle.Cx(130).Cy(130).R(60).Fill(Paint.None).Stroke(Color.FromArgb(200, 0, 0)).StrokeWidth(70).StrokeDashArray(2, 14))
.AddText("I can create SVG from scratch!", x: 270, y: 140, fontSize: 30, fill: Color.Teal)
)
.Build(document.FirstChild as SVGSVGElement);
// Save the document
document.Save(Path.Combine(OutputDir, "svg-from-scratch.svg"));
Source – Element Builders – Create and Edit SVG Elements
Quickly convert SVG files to PNG images using the Aspose.SVG for .NET library. A simple solution for rendering high-quality PNGs from SVG documents:
// Initialize an SVG document from a file
using (SVGDocument document = new SVGDocument("image.svg"))
{
// Initialize ImageSaveOptions
ImageSaveOptions saveOptions = new ImageSaveOptions();
// Convert SVG to PNG
Converter.ConvertSVG(document, saveOptions, "image.png");
}
Source – Convert SVG to Images
Combine multiple SVG files into a single PDF with the Aspose.SVG for .NET API. The Render() method allows you to send several documents at once to the output rendering device and merge them:
// Load multiple SVG documents from files
using (SVGDocument document1 = new SVGDocument(Path.Combine(DataDir, "circle.svg")))
using (SVGDocument document2 = new SVGDocument(Path.Combine(DataDir, "flower.svg")))
using (SVGDocument document3 = new SVGDocument(Path.Combine(DataDir, "lineto.svg")))
{
// Initialize the SvgRenderer for rendering multiple SVGs
using (SvgRenderer renderer = new SvgRenderer())
{
// Create a PdfDevice to save the output as a PDF
using (PdfDevice device = new PdfDevice(Path.Combine(OutputDir, "result.pdf")))
{
// Render and merge all SVG documents into a single PDF
renderer.Render(device, document1, document2, document3);
}
}
}
Source – How to Merge SVG Files
You can perform SVG transformations such as rotation, scaling, and translation on individual elements or the entire SVG document. The following C# code snippet demonstrates how to find the desired SVG element (the first <rect>) in an existing SVG file and rotate it around its center.
// Load an SVG document
using (SVGDocument document = new SVGDocument(Path.Combine(DataDir, "shapes.svg")))
{
// Find the first <rect> element for rotation
SVGRectElement rect = document.GetElementsByTagName("rect").First() as SVGRectElement;
// Rotate the first <rect> element around its center using the SVGRectElementBuilder
new SVGRectElementBuilder()
.Transform(t => t.Rotate(45, 100, 140))
.Build(rect);
// Save the document
document.Save(Path.Combine(OutputDir, "rotate-element-using-builder.svg"));
}
Source – Rotate SVG
Implement the image vectorization process and work with various pre-processing options for images before saving them in vector format:
// Initialize an instance of the ImageVectorizer class
ImageVectorizer vectorizer = new ImageVectorizer
{
// Optionally set configuration
Configuration =
{
// Optionally set path builder
PathBuilder = new BezierPathBuilder {
// Optionally set trace smoother
TraceSmoother = new ImageTraceSmoother(2),
},
ColorsLimit = 10,
LineWidth = 1
}
};
// Vectorize image from the specified file
using SVGDocument document = vectorizer.Vectorize("flower.png");
// Save the vectorized image as an SVG file
document.Save("flower.svg");
Source – Image Vectorization
👁 Product Page
👁 Docs
👁 Reference
👁 Examples
👁 Blog
👁 Releases
👁 Support
👁 License
SVG Creation | SVG Conversion | SVG Manipulation | Vector Graphics | Image Vectorization | Text Vectorization | SVG Optimization | SVG to PDF | SVG to PNG | Image Conversion | Rendering Options | Custom Configuration | CSS Selector | XPath Navigation | SVG Filters | SVG Gradients | SVG Transformations | Advanced SVG Features | SVG to XPS | Document Merging | SVG Builder API | High-Quality Rendering | Bitmap Rendering | Path Builder | PDF Export | SVG Document Navigation | Logging and Message Handlers | Image Formats
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
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. |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 26.5.0 | 726 | 5/29/2026 |
| 26.4.0 | 3,392 | 4/30/2026 |
| 26.3.0 | 3,599 | 3/31/2026 |
| 26.2.0 | 2,873 | 2/27/2026 |
| 26.1.0 | 2,245 | 1/30/2026 |
| 25.12.0 | 4,323 | 12/22/2025 |
| 25.11.0 | 6,214 | 11/29/2025 |
| 25.10.0 | 3,614 | 11/14/2025 |
| 25.9.0 | 9,274 | 9/29/2025 |
| 25.8.0 | 5,895 | 8/21/2025 |
| 25.7.0 | 9,834 | 7/24/2025 |
| 25.6.0 | 14,916 | 6/20/2025 |
| 25.5.0 | 8,400 | 5/15/2025 |
| 25.4.0 | 11,153 | 4/11/2025 |
| 25.3.0 | 7,878 | 3/9/2025 |
| 25.2.0 | 8,362 | 2/18/2025 |
| 25.1.0 | 4,515 | 1/30/2025 |
| 24.12.0 | 14,341 | 12/18/2024 |
| 24.11.0 | 12,464 | 11/27/2024 |
| 24.10.0 | 22,451 | 10/30/2024 |