Combine SVG, JPEG, PNG or other Images using C#

Merge SVG or Image files together and save the result to popular formats including PDF, XPS, BMP, JPEG, PNG, GIF, and TIFF using C#

How to Merge SVG & Images Using C#

There are a lot of reasons why you need to combine several SVGs or Images into one document. To merge SVG files, we will use Aspose.SVG for .NET API which is a powerful and easy-to-use document manipulation API for the C# platform. Our C# library provides the SvgRenderer class for rendering and merging SVG documents. The Render() method gives you the ability to send multiple documents at once to the output rendering device and merge them.

C# example to combine SVG to PDF

A high-speed C# library allows .NET developers to merge SVG files and convert the combined result into many popular formats such as PDF, XPS, JPEG, PNG, BMP, GIF, and TIFF with high quality and efficiency. Documents merging can be done with a few lines of code:

Merge SVG to PDF - C#

// Initialize SVG documents from files to merge 
using (var document1 = new SVGDocument("document1.svg"))
using (var document2 = new SVGDocument("document2.svg"))
using (var document3 = new SVGDocument("document3.svg"))
{
    // Create an instance of SvgRenderer
    using var renderer = new Aspose.Svg.Rendering.SvgRenderer();	
    // Create an instance of SvgRenderer
    using var device = new Aspose.Svg.Rendering.Pdf.PdfDevice("result.pdf");
    //Merge all SVG documents to PDF
    renderer.Render(device, document1, document2, document3);                
}

SVG Merger in Documentation

Aspose.SVG for .NET library lets you create, edit, read, convert, and merge SVG files programmatically using C#. The Aspose.Svg.Rendering namespace implements easy access to convert and merge methods. In addition, it provides combining SVG files into popular formats, such as PDF, XPS, JPEG, PNG, BMP, TIFF, and GIF. Please visit the documentation chapter How to Merge SVG Files to learn more about SVG C# API merging features.

Installing Aspose.SVG for .NET library

Aspose.SVG for .NET is a cross-platform flexible library that is designed to provide a wide range of features for processing and rendering SVG documents. It seamlessly integrates into your .NET Apps to work with SVG files without installing any 3rd party software. Our SVG .NET API can be used with any .NET language, such as C#, VB.NET, ASP.NET, etc. It works equally well on any OS that can install Mono (.NET 4.0 Framework support) or use .NET core. This includes Windows, Linux, and macOS.

Installing Aspose.SVG для .NET through NuGet :

  1. Using the Package Manager Console.
  2. Using the NuGet Package Manager GUI.

For more details about C# library installation, please refer to Aspose.SVG Documentation .

Other Supported Mergers

You can combine SVG files into many other file formats including few listed below: