Convert SVG to PDF with NET REST API

In this simple topic, you’ll learn how to convert SVG to PDF with NET REST API. We will develop a SVG to PDF converter with C# Low Code API by following the detailed and lucid steps mentioned in the following section. The created application can be integrated with any .NET application supported in Windows, Linux, or macOS environments and conversion can be done for free.

Prerequisite

Steps to Convert SVG to PDF with NET REST API

  1. Set the Client ID and Client Secret for the API to convert SVG to PDF
  2. Create an instance of ImagingAPI class with client credentials to perform SVG to PDF conversion
  3. Specify the source SVG and output PDF file names
  4. Read the source SVG file and upload it to cloud storage
  5. Create an instance of the ConvertImageRequest with input SVG file stream and output PDF format
  6. Call the ConvertImage method to convert SVG to PDF with NET REST API
  7. Save the rendered PDF file stream on the local disk

The aforementioned steps transform the file type from SVG to PDF with C# Low Code API. We will start the process with the initialization by configuring the SDK and creating the ImagingAPI class object. We will then access the source SVG file using a FileStream and create an instance of the ConvertImageRequest class that is further used for performing the conversion to a PDF file stream using the ConvertImage() method.

Code for SVG to PDF Conversion in NET Low Code API

This simple example code lets you convert SVG to PDF with C# Cloud API. You only need to provide a valid path for the SVG image on the disk with the help of the Aspose.Imaging REST API SDK, perform the conversion and then after the conversion process is completed, download the output PDF file stream to save it locally.

In this topic, we have learned to transform SVG to PDF with Cloud API. If you are interested in performing PNG to PDF conversion, refer to the article on how to Convert PNG to PDF with NET REST API.

 English