SVG Conversion in C# – Convert SVG and Images

Quick Answer

Aspose.SVG for .NET converts SVG documents to PDF, XPS, PNG, JPG, WebP, BMP, TIFF, GIF, and SVGZ. It can also vectorize raster images such as PNG, JPG, BMP, TIFF, GIF, and ICO into SVG. Use this page as a conversion map: choose the target workflow below, then open the focused guide with code examples and options.

For a format-level overview, see Supported File Formats.

Choose a Conversion Guide

GoalStart here
Convert SVG to PDF for documents, reports, or printingConvert SVG to PDF in C#
Convert SVG to PNG, JPG, WebP, BMP, TIFF, or GIFConvert SVG to Images in C#
Convert SVG to XPS fixed-layout outputConvert SVG to XPS in C#
Resize or control output page size during conversionResize Document During Conversion
Compress SVG as SVGZConvert SVG to SVGZ in C#
Decompress SVGZ to editable SVGConvert SVGZ to SVG in C#
Vectorize PNG, JPG, BMP, TIFF, GIF, or ICO to SVGConvert Image to SVG in C#

Conversion APIs in Aspose.SVG for .NET

Image-to-SVG conversion is a vectorization workflow. Use Converter.ConvertImageToSVG() for direct raster-to-SVG output, or ImageVectorizer when you need the vectorized result as an SVGDocument.

Online SVG Converter

Use the interactive converter to test SVG output before adding the same workflow to a C# application. Load an SVG file, choose the target format, and download the converted result with default save options.

                
            

Conversion Options

SVG rendering options control output appearance without changing the source SVG. Common settings include background color, CSS handling, page setup, margins, and horizontal or vertical resolution. Format-specific options live in classes such as PdfSaveOptions, XpsSaveOptions, and ImageSaveOptions.

If the output is cropped, has unexpected page size, missing fonts, missing images, or an unexpected background, start with the focused troubleshooting sections in Convert SVG to PDF and Convert SVG to Images.

FAQ

What is the easiest way to convert SVG in C#?
Use Converter.ConvertSVG() with the appropriate save options, such as PdfSaveOptions, XpsSaveOptions, or ImageSaveOptions.

When should I use RenderTo() instead of ConvertSVG()?
Use RenderTo() when your application already works with rendering devices or needs explicit control over PdfDevice, XpsDevice, or ImageDevice.

Can Aspose.SVG convert SVGZ files?
Yes. Aspose.SVG for .NET can load SVGZ as compressed SVG content. You can convert SVGZ to SVG, render SVGZ to PDF or PNG, or save SVG as SVGZ for compressed delivery.

Is image to SVG conversion the same as SVG rendering?
No. SVG rendering takes SVG input and creates PDF, XPS, or raster output. Image to SVG conversion is vectorization: it traces raster pixels into SVG paths.

Related Resources

Aspose.SVG offers a free online SVG Converter for converting SVG files to a variety of popular formats. You can easily convert SVG to PDF, XPS, JPG, PNG, BMP, TIFF, GIF, WebP, and SVGZ. Just select a file, choose the format to convert, and you’re done. It’s fast and completely free!

SVG Converter