Convert JPG to PDF with NET REST API

In this simple topic, you’ll learn how to convert JPG to PDF with NET REST API. We will create a JPG to PDF converter with C# Low Code API by following the detailed instructions and simple steps mentioned in the following section. This example 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 JPG to PDF with NET REST API

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

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

Code for JPG to PDF Conversion in NET Low Code API

This working example code lets you to convert JPG to PDF with C# Cloud API. You are suppose to load a source JPG file with the help of the Aspose.Imaging REST API SDK and get the output PDF file stream after conversion process, which is then saved as a file locally on the disk.

In this topic, we have a hands on experience to transform JPG to PDF with Cloud API. If you are interested in performing BMP to WEBP conversion, refer to the article on how to Convert BMP to WEBP with NET REST API.

 English