SVG to PDF Conversion using C#

SVG is one of the most used formats for website building and print graphics to achieve scalability. But sometimes, you need to convert SVG and save it in another file format. With Aspose.SVG for .NET API, you can transform SVG to PDF programmatically with full control over a wide range of conversion parameters. Powerful C# API allows you to convert SVG to popular formats with high speed and high quality.

Free Online Converter

Test the quality of SVG to PDF conversion right in your browser! The following C# example demonstrates how to convert an SVG document using ConvertSVG() method. We describe the source code for reading SVG from a file and then converting SVG to PDF with default saving options. Please load SVG from the local file system, select the output format and run the example. You will immediately get the result as a separate file.

Please visit our Documentation to learn more about using Aspose.SVG API conversion functions and to consider C# examples for the most common SVG conversion scenarios. In the documentation chapter How to Convert SVG Files , you can consider C# examples of how to convert SVG to PDF in different ways. Let’s consider some of them:

Steps to Convert SVG to PDF using ConvertSVG() Method

  1. Load an SVG file using one of the SVGDocument() constructors of the SVGDocument class.
  2. Create a new PdfSaveOptions object.
  3. Use the ConvertSVG() method to save SVG as a PDF file. You need to pass the SVGDocument, PdfSaveOptions, and output file path to the ConvertSVG() method.
  4. The PDF file will be saved to the specified path.

Steps to Convert SVG to PDF using RenderTo() Method

  1. Initialize SVGDocument with your SVG file.
  2. Create an object of the PdfRenderingOptions class. Use the PdfRenderingOptions() constructor and specify the Format property of the document.
  3. Initialize PdfDevice class and specify the output file name to render.
  4. Call RenderTo() method & pass the instance of the PdfDevice.

Convert SVG to PDF

using (var document = new SVGDocument("input.svg"))
	var options = new PdfRenderingOptions();
	using (IDevice device = new PdfDevice(options, "output.pdf"))


1. How can I convert SVG to PDF?

Aspose.SVG allows you to convert SVG to other formats in any way - online or programmatically. You can convert SVG in real-time using SVG Converter, which transforms your files quickly and with high quality. Upload, convert SVG and get results in a few seconds.

2. What other file formats can I convert SVG to?

Aspose.SVG API provides a wide range of SVG conversions to popular formats, such as PDF, XPS, DOCX, JPEG, PNG, BMP, TIFF, and GIF.

3. Why should I convert SVG?

Vector graphics is one of the most popular Web design trends in recent years. All modern browsers support SVG, and it would seem that the Web should already switch to vector graphics. However, there are some restrictions on the use of SVG, and you need to convert SVG.

Get Started with .NET SVG API

If you are interested in developing scalable vector graphics and their application, install our flexible, high-speed Aspose.SVG for .NET API with a powerful set of interfaces for C# and other .NET programming languages.
Install from command line as nuget install Aspose.SVG or via Package Manager Console of Visual Studio with Install-Package Aspose.SVG. Alternatively, get the offline MSI installer or DLLs in a ZIP file from downloads. Aspose.SVG for .NET API is a standalone library and does not depend on any software for SVG document processing.
For more details about C# library installation and system requirements, please refer to Aspose.SVG Documentation.

Other Supported SVG Conversions

You can also convert SVG to many other file formats:

SVG TO PDF (Portable Document Format)
SVG TO XPS (XML Paper Specifications)
SVG TO BMP (Bitmap Image)
SVG TO IMAGE (Image formats)
SVG TO GIF (Graphical Interchange Format)
SVG TO PNG (Portable Network Graphics)
SVG TO TIFF (Tagged Image Format)