Skip to content

aspose-svg/Aspose.SVG-for-.NET

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Home | Product Page | Docs | API Reference | NuGet | Blog | Search | Free Support | Temporary License

NuGet NuGet GitHub

Aspose.SVG for .NET – Process and Manipulate SVG via .NET API

Aspose.SVG for .NET is an API for working with Scalable Vector Graphics (SVG) in .NET applications. It enables developers to programmatically create, load, edit, traverse, render, vectorize, save, and convert SVG documents without relying on external graphics tools.

This repository provides practical developer documentation and ready-to-run C# examples to help you integrate SVG processing into .NET applications.

Repository Structure

This repository is organized to help you find what you need quickly:

Directory Description
Docs Short developer guides and getting-started articles for Aspose.SVG for .NET.
Examples Ready-to-run C# examples and shared sample data.

The Docs and Examples folders are designed to be used together: documentation explains the concepts, while examples demonstrate working code.

Key Capabilities

Aspose.SVG for .NET covers common SVG workflows required in real-world .NET applications:

  • Create and load SVG documents from files, streams, URLs, or memory strings.
  • Edit SVG content using DOM APIs for elements, attributes, paths, styles, colors, and text.
  • Traverse and inspect the SVG DOM using DOM navigation, CSS selectors, and XPath.
  • Convert SVG to PDF for document publishing and reporting scenarios.
  • Convert SVG to raster images such as PNG, JPEG, BMP, TIFF, and GIF.
  • Save SVG as SVGZ for compressed SVG storage and delivery.
  • Render SVG with configurable options such as page setup, background color, resolution, and image quality.
  • Vectorize raster images and text into SVG paths.
  • Build SVG programmatically with the SVG Builder API.

The API is designed for automation, batch processing, backend services, desktop applications, and server-side SVG workflows.

Quick Start

Convert SVG to PDF in C#

Aspose.SVG for .NET allows you to convert SVG files to PDF documents using a single API call. This approach is useful for server-side applications, reporting systems, and document generation workflows.

using Aspose.Svg.Converters;
using Aspose.Svg.Saving;

Converter.ConvertSVG("image.svg", new PdfSaveOptions(), "image.pdf");

Convert SVG to Image Formats in C#

You can convert SVG documents to raster image formats by loading the SVG into an SVGDocument and applying ImageSaveOptions. This is useful for previews, thumbnails, and bitmap-based output.

using Aspose.Svg;
using Aspose.Svg.Converters;
using Aspose.Svg.Rendering.Image;
using Aspose.Svg.Saving;

using (var document = new SVGDocument("image.svg"))
{
    var saveOptions = new ImageSaveOptions(ImageFormat.Jpeg);
    Converter.ConvertSVG(document, saveOptions, "image.jpeg");
}

Vectorize Images – Convert Raster Files to SVG

Aspose.SVG for .NET supports image vectorization, allowing you to convert raster images such as PNG or JPEG into scalable SVG graphics.

using Aspose.Svg;
using Aspose.Svg.ImageVectorization;

var vectorizer = new ImageVectorizer();

using (SVGDocument document = vectorizer.Vectorize("flower.png"))
{
    document.Save("flower.svg");
}

Getting Started with Aspose.SVG for .NET

  1. Install Aspose.SVG for .NET using NuGet:

    dotnet add package Aspose.SVG

    Or use Visual Studio Package Manager Console:

    Install-Package Aspose.SVG
  2. Review the Docs/getting-started section for installation, licensing, supported features, and supported file formats.

  3. Explore the Examples folder to see common scenarios in action.

  4. Use the API Reference for detailed class and method descriptions.

Run C# Examples

From the repository root, run a C# examples section:

dotnet run --project Examples\CSharp\CSharp.csproj -- --section WorkingWithSVGDocument

For the full section list and Visual Studio launch profile instructions, see Examples/CSharp/README.md.

Contribution and Support

To contribute changes to this repository:

  1. Create a branch with the proposed changes.
  2. Update or add focused examples and documentation.
  3. Open a pull request for review.

If you encounter issues, have questions, or need technical assistance:

Licensing

Aspose.SVG for .NET is a commercial library. You can start with a free evaluation and later apply a license for production use. Licensing details and instructions are available in the Licensing documentation.

Home | Product Page | Docs | API Reference | NuGet | Blog | Search | Free Support | Temporary License

About

Aspose.SVG for .NET examples, plugins and showcase projects

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors