In this tutorial, we’ll be demonstrating how to convert an image to PDF using ByteScout Cloud API Server.
Here, we have:
- API Server documentation
- API Server Base URL
- Sample image URL. Please note that I am using a local image URL here. However, it can be any publicly accessible image URL.
First thing first, let’s go to documentation and get API Endpoint URL for the image to PDF conversion. Which is ‘/pdf/convert/from/image’. For this demo purpose, we will be using a GET request; however, in production one should use a POST request only.
Let’s copy-paste the endpoint URL and append it to the API Server base URL.
Now, coming to all parameters; it has parameters such as URL, name, async, etc. “URL” represents the input URL of the image. “Name” parameter is used to name the output PDF.
Okay! Let’s update the request URL with these parameters.
Now that we have the request endpoint URL completed, let’s try it out in the browser itself. It has returned JSON with the resulting PDF in the ‘url’ field. Upon inspecting the URL we confirmed that it’s a PDF file containing the input image. Cool!