In this basic topic, you’ll explore how to convert SVG to JPG with NET REST API. We will create an SVG to JPG converter with C# Low Code API by adhering to the comprehensive steps mentioned in the following sections. The generated application can be utilized with any .NET application supported in macOS, Windows, or Linux environments and conversion can be done for free.
Prerequisite
- Create an account and get API credentials to perform SVG to JPG conversion
- Download Aspose.Imaging Cloud SDK for .NET to export SVG to JPG
- Configure the C# .NET project with the above SDK to convert an SVG file to JPG
Steps to Convert SVG to JPG with NET REST API
- Set the Client ID and Client Secret for the API to render SVG to JPG
- Instantiate the ImagingAPI class with user credentials to perform SVG to JPG conversion
- Specify the source SVG and output JPG file names
- Access and load the source SVG file and upload it to cloud storage
- Create an instance of the ConvertImageRequest with input SVG file stream and output JPG format
- Call the ConvertImage method to convert SVG to JPG with NET REST API
- Save the response JPG file stream on the local disk
The basic steps entail exporting the file type from SVG to JPG with C# Low Code API. We will commence with the initialization of the SDK by using an instance of the ImagingAPI class. We will then load the source SVG file using a FileStream from the disk and then by using a ConvertImageRequest class instance perform the conversion to a JPG using the ConvertImage() method.
Code for SVG to JPG Conversion in NET Low Code API
This crisp example code demonstrates how to convert SVG to JPG with C# Cloud API. After addressing the required pre-requisite steps, you have to provide a path to access the source SVG image on the disk and by using the Aspose.Imaging REST API SDK performs the rendering to JPG. The resultant JPG image file stream is received as a response after the conversion is completed and you can then save it locally on the disk.
In this article, we have explored transforming SVG to JPG with Cloud API. If you are interested in performing SVG to PNG conversion, refer to the article on how to Convert SVG to PNG with NET REST API.