Merge Combine SVG to PDF XPS csharp

SVG (Scalable Vector Graphics) images are frequently used to maintain the quality of images. In some scenarios, you may need to merge or combine multiple SVG image files together. In this article, you will learn how to merge SVG images to a PDF or XPS file. Please explore the following sections for further details:

Combine or Merge Multiple SVG Images to a Single PDF or XPS File – C# API Installation

Aspose.SVG for .NET API is designed to create, manipulate, or convert SVG files to supported file formats. You can easily use the API by downloading its reference files from the Downloads section, or using the following NuGet installation command:

PM> Install-Package Aspose.SVG

Merge SVG Images to a PDF File with C#

You can easily merge different SVG images into a PDF file. Each SVG image will be rendered on a separate page of the PDF file. To merge SVG files to a PDF file, you need to follow the steps below:

  1. Initialize SVG documents from files to merge images.
  2. Create an instance of SvgRenderer class.
  3. Specify different properties using PdfRenderingOptions object.
  4. Create an instance of PdfDevice class.
  5. Merge the SVG image files to a PDF document.

The following code shows how to merge or combine SVG images to a PDF document with C#:

Merge SVG Images to an XPS File using C#

You can merge SVG images to an XPS file with the following steps:

  1. Load input SVG Images to merge.
  2. Initialize an object of SvgRenderer class.
  3. Create an instance of XPSRenderingOptions class.
  4. Specify output XPS page size, margins, etc.
  5. Create an instance of XpsDevice type.
  6. Merge or combine all SVG documents to an XPS file.

The code sample below explains how to merge or combine SVG images to an XPS file in C#:

Get Free Temporary License

You can request a Free Temporary License to evaluate all the features of the API without any restrictions.

Conclusion

In this article, you have learned how to merge multiple SVG image files to a PDF or XPS file with high fidelity results. Both use cases are discussed along with the code samples so that you can quickly try out these features of the API. Furthermore, you can explore API Documentation to check out other features of the API. In case of any concerns, please feel free to contact us at the Free Support Forum.

See Also